Problem passing password
Hi,
Situation:
Main exe calls for DLL which shows report.
On the DLL side from the incoming parameter's
(received from the main exe) reads the basic things
to be able to connect to the database
(Server Name, Database Name, User Name and Password).
In my report on the Fast report side I've a ADODatabase component.
I'm passing a connenction string to it.
Problem:
The problem is that it ignores the password parameter sent to it.
{Delphi7, FastReport 3.19}:
How to fix this? Here's my code
CODE:
var connection_string: String;
connection_string: :=
'Provider=SQLOLEDB.1;' +
'Password=' + password + ';' +
'Persist Security Info=False;' +
'User ID=' + username + ';' +
'Initial Catalog=' + baza + ';' +
'Data Source=' + server + ';' +
'Use Procedure for Prepare=1;' +
'Auto Translate=True;' +
'Packet Size=4096;' +
'Workstation ID=' + naziv_racunala + ';' +
'Use Encryption for Data=False;' +
'Tag with column collation when possible=False;';
ADODatabase1 := Form1.Report.FindObject('ADODatabase1') as TfrxADODatabase;
ADODatabase1.Connected := False;
ADODatabase1.DatabaseName := connection_string;
ADODatabase1.Connected := True;
Report.PrepareReport;
Report.ShowPreparedReport;
Thanks in advance
Josko
Situation:
Main exe calls for DLL which shows report.
On the DLL side from the incoming parameter's
(received from the main exe) reads the basic things
to be able to connect to the database
(Server Name, Database Name, User Name and Password).
In my report on the Fast report side I've a ADODatabase component.
I'm passing a connenction string to it.
Problem:
The problem is that it ignores the password parameter sent to it.
{Delphi7, FastReport 3.19}:
How to fix this? Here's my code
CODE:
var connection_string: String;
connection_string: :=
'Provider=SQLOLEDB.1;' +
'Password=' + password + ';' +
'Persist Security Info=False;' +
'User ID=' + username + ';' +
'Initial Catalog=' + baza + ';' +
'Data Source=' + server + ';' +
'Use Procedure for Prepare=1;' +
'Auto Translate=True;' +
'Packet Size=4096;' +
'Workstation ID=' + naziv_racunala + ';' +
'Use Encryption for Data=False;' +
'Tag with column collation when possible=False;';
ADODatabase1 := Form1.Report.FindObject('ADODatabase1') as TfrxADODatabase;
ADODatabase1.Connected := False;
ADODatabase1.DatabaseName := connection_string;
ADODatabase1.Connected := True;
Report.PrepareReport;
Report.ShowPreparedReport;
Thanks in advance
Josko
Comments
The report with the valid data is shown.
Somehow it read the password and it connected to the database.
And then it showed the message "Login failed".
I'm in complete mistery why is it trying to connect again,
why it say's "invalid password" and
what component is trying to connect since I only have one (ADODatase) in my report.
maybe you should try to set this option in your Connectionstring:
instead of
This gives the connection the ability to save the password...