i want to change MyConnection1.Password but ...
i want to change MyConnection1.Password but ...
Hi,
MyConnection1.Password := 'mypassword';
MyConnection1.Connected := True;
MyConnection1.Password := ''; // <== MyConnection1 automatic disconnected.
i want to change MyConnection1.Password but I don't want to
MyConnection1 disconnected;
sorry my english little.
thanks.
best regards.
MyConnection1.Password := 'mypassword';
MyConnection1.Connected := True;
MyConnection1.Password := ''; // <== MyConnection1 automatic disconnected.
i want to change MyConnection1.Password but I don't want to
MyConnection1 disconnected;
sorry my english little.
thanks.
best regards.
thanks but this is not my problem and solution
i am not want to user password.
i want to Password property of MyConnection Component.
but when i changed password property, if MyConnection.Connected then MyConnection auto disconnected but i don't want disconnected.
sorry little english.
thanks
best regards.
i want to Password property of MyConnection Component.
but when i changed password property, if MyConnection.Connected then MyConnection auto disconnected but i don't want disconnected.
sorry little english.
thanks
best regards.
Re: i want to change MyConnection1.Password but ...
Changing MyConnection.Password property has no sense for the established connection.
please try example, Ikar
thanks Ikar
but....
try please example.
procedure TForm1.Button1Click(Sender: TObject);
begin
MyConnection1.Password := 'mypass';
MyConnection1.Connected := True;
// ok no problem
if MyConnection1.Connected then
showmessage('connection ok.') // ok no problem
else
showmessage('not connection');
MyConnection1.Password := '';
if MyConnection1.Connected then
showmessage('connection ok.')
else
showmessage('not connection'); // PROBLEM
end;
i want to change password and i want to not disconnect.
i want to security.
this solution for security.
because hack programs viewing component properties.
thanks.
best regards.
but....
try please example.
procedure TForm1.Button1Click(Sender: TObject);
begin
MyConnection1.Password := 'mypass';
MyConnection1.Connected := True;
// ok no problem
if MyConnection1.Connected then
showmessage('connection ok.') // ok no problem
else
showmessage('not connection');
MyConnection1.Password := '';
if MyConnection1.Connected then
showmessage('connection ok.')
else
showmessage('not connection'); // PROBLEM
end;
i want to change password and i want to not disconnect.
i want to security.
this solution for security.
because hack programs viewing component properties.
thanks.
best regards.
Re: please try example, Ikar
To store a password in source code is unsafe, regardless where you put it - .dfm or .pas files. The best choice for security reasons is probably to ask user for password.
What does not suit you in behavior where a connection is reestablished?
What does not suit you in behavior where a connection is reestablished?
dear IKAR,
i do not store the password in .dfm or .pas
my problem is after the connection, i want to make this: MyConnection1.Password:=''
but when use this MyConnection1.Password:='' , MyConnection1 disconnect automatically.
after i get the password from user and establish the connection, i want to clean the value of object password property.
example in my last reply was sent explain to my problem. if you run that codes you can understand what i try to say.
Thanks,
i do not store the password in .dfm or .pas
my problem is after the connection, i want to make this: MyConnection1.Password:=''
but when use this MyConnection1.Password:='' , MyConnection1 disconnect automatically.
after i get the password from user and establish the connection, i want to clean the value of object password property.
example in my last reply was sent explain to my problem. if you run that codes you can understand what i try to say.
Thanks,