TMSconnection - strange behavior
Posted: Wed 30 Oct 2019 08:44
for example:
in design i set in object inspector:
loginprompt:=false;
password:='';
then in code:
{mscon:tmsconnection;s:string;}
s:='Provider=TDS;Data Source=localhost;User ID=sa;Password=123';
if mscon.LoginPrompt then showmessage('loginpromt is set to true') else showmessage('loginpromt is set to false');
//here is loginpromt of course false yet
mscon.ConnectString:=s;//here is automatically set loginprompt to true (ignores design settings, in constr there is no reason..)
if mscon.LoginPrompt then showmessage('loginpromt is set to true') else showmessage('loginpromt is set to false');
//here is loginpromt already true, no setting true is in constr, so why is automatically set to true ???
ShowMessage(mscon.ConnectString);
//here is connectionstring with password yet
mscon.Connect;
{here appears loginpromt dialog ! (even though it was set up in the design to false, and not set by connectstr)
in addition, password box is empty even though it was set up by connectsr !
}
in design i set in object inspector:
loginprompt:=false;
password:='';
then in code:
{mscon:tmsconnection;s:string;}
s:='Provider=TDS;Data Source=localhost;User ID=sa;Password=123';
if mscon.LoginPrompt then showmessage('loginpromt is set to true') else showmessage('loginpromt is set to false');
//here is loginpromt of course false yet
mscon.ConnectString:=s;//here is automatically set loginprompt to true (ignores design settings, in constr there is no reason..)
if mscon.LoginPrompt then showmessage('loginpromt is set to true') else showmessage('loginpromt is set to false');
//here is loginpromt already true, no setting true is in constr, so why is automatically set to true ???
ShowMessage(mscon.ConnectString);
//here is connectionstring with password yet
mscon.Connect;
{here appears loginpromt dialog ! (even though it was set up in the design to false, and not set by connectstr)
in addition, password box is empty even though it was set up by connectsr !
}