Skip to Content
0
Former Member
May 09, 2008 at 05:15 PM

Setting database for report

42 Views

Post Author: MarkSmits

CA Forum: Other

Using BDS2006 with CrystalVCL 11.

My reports are designed for a database called db_test. Now I want my report to run on a database called db.

Running the example application CrystalVCL.exe I am able to change the ConnectBuffer setting for the three tables in that report. I can change the database property with the correct name and I set UseDSNProperties to -1. When I preview the report, I see the data coming from the correct database.

Now I try to do the same with Delphi. I use the following code:

for i := 0 to cr.Tables.Count - 1 do begin tempVar := cr.Tables[i];

tempVar.ConnectBuffer := StringReplace(tempVar.ConnectBuffer, 'UseDSNProperties=0', 'UseDSNProperties=-1', [rfReplaceAll, rfIgnoreCase]);

end;

When I try this, I get a ECrpeError code 536 saying (translating from Dutch) "Cannot make connection. Invalid login parameters. Tables&#91;0&#93;.SetConnectBuffer <>PENth...>"

What am I doing wring here ?