Platform: Laz 1.8.1 Fpc 3.0.5, IBX 2.1.0 on Windows Server Essentials 2016
I am using the TIBDatabase component to connect to a database.
I would like my users to use the built-in login prompt in the TIBDatabase component, but I need to capture the username and password that the user just typed in to connect, so that I can store it in a TBufDataset for use all during the session. When the session is closed, the TBufDataset is discarded so the passwords will not be stored. I'm wondering how I can capture what the user just entered. Here is some code I'm trying. Interestingly, the built-in Login prompt does create a USERNAME parameter, however it doesn't create a PASSWORD parameter. I need to capture both.
...
repeat
try
fb_db.Connected := True;
if fb_db.Connected then
begin
if SameText(ths_usr, 'ASKME') and SameText(ths_pwd, 'ASKME') then
begin
ths_usr := fb_db.Params.Values['USER_NAME']; //<--- Works!
ths_pwd := fb_db.Params.Values['PASSWORD']; // <-- empty.
end;
...