Search code examples
delphicrystal-reports

Delphi 5 & Crystal XI Rel. 2 (RDC) how to?


I'm trying to work with the class from JosephStyons but I do get an "Invalid Index" Error on the line where the "User ID" should get set.

FRpt.Database.Tables[i].ConnectionProperties.Item['User ID'] := edUserName.Text;

Here's my environment:

WinXP Sp3, Crystal Reports Developer XI Rel.2 SP4, Delphi 5 Update Pack 1

Any help or ideas greatly appreciated!

Thx, Reinhard


Solution

  • Your value for [i] could be the culprit...I can't remember for sure but I believe the first table will be Table[1] instead of Table[0] as one would expect.

    I altered my loop to use:

    CrTables := CrDatabase.Tables;
    for crTableObj in crTables do
    

    You might try stepping through the table using a for loop as shown above or by starting with 1 instead of 0.

    I hope this helps.