Problem passing password

edited 10:47AM in FastReport 3.0
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

Comments

  • edited 10:47AM
    Here is what I've noticed:
    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.
  • edited 10:47AM
    I reproduced a simple demo (with DLL) to reproduce this error and I would like to send it to the guys at FastReport. How do I contact them and send them the demo? Please help.
  • edited 10:47AM
    Hi,

    maybe you should try to set this option in your Connectionstring:
    Persist Security Info=True
    

    instead of
    Persist Security Info=False
    

    This gives the connection the ability to save the password...

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.