Все разобрался....
( оказалось все намного проще чем думал )
Вот решение моё...
Код:
1 2 3 4 5 6 7 8 9 10 11 12 13 | if ComboBox1 . ItemIndex= 0 then
advstr:= 'User ID=User1;Password=' + pass;
if ComboBox1 . ItemIndex= 1 then
advstr:= 'User ID=User2;Password=' + pass;
AdoConnection1 . ConnectionString:= 'Provider=SQLOLEDB.1;Persist Security Info=False;' +advstr+ ';Initial Catalog=' имя вашей базы ';Data Source=' имя сервера ';Use Procedure for Prepare=1;' ;
try
ADOConnection1 . Connected:= true ;
FormSecurity . Close;
except
ADOConnection1 . Connected:= false ;
ShowMessage( 'Пароль введён не верно!' );
pass:= '' ;
Edit1 . Text:= '' ;
|