Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: How to connect Crystal Reports 8.5 template to SQL Server at run time?



Permlink Replies: 0
Tom Field

Posts: 43
Registered: 3/6/14
How to connect Crystal Reports 8.5 template to SQL Server at run time?
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 6, 2016 3:05 PM
Can anyone show us some sample code to login (Windows and SQL Authentication) and connect from D7 via UCRPE32.pas two SQL Server tables

We are migrating from Paradox/BDE app to SQL Server.

Up until now, we've used Delphi 7 calls to UCrpe.pas for Crystal Reports 8.5 and its VCL viewer. These of course are long since unsupported, but we need to continue using them for the time being.

We are able to use the CR Designer's Set Location to connect to SQL Server while in the CR Designer. We can then edit and view reports based on SQL Server data perfectly (which really amazes us, given how old this tool is.)

But, in the shipping product we need to connect to the SQL Server at run-time from Delphi rather than in the CR Designer. (Since customers will have different connection strings and perhaps even different database names.)

In the past, to "connect" to Paradox tables, at runtime in Delphi 7 we set Tables[TableIndex].Name and .Path to the Paradox table and then eventually did an .Excute.

We haven't been able to figure out the calls to make to replace the above .Name and .Path assignments with a connection string to a SQL Server using Windows Authentication.

We've examined UCRPE32.pas (all 50,000+ lines!) and techref-CRPE32 reference.pdf (all 700 pages!) and are lost. Do we have to connect each table if there is more than one? Are there special dll's we have to reference explicitly? How do we specify Windows Authentication vs SQL Authentication? etc.

There is TCrpeLogOnInfo, TCrpeLogOnServerItem, etc., etc.

Can anyone show us some sample code to login and connect from D7 via UCRPE32.pas two tables (via Windows or SQL Authentication... both needed at different times.)
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02