Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Active Data & Linking 1

Status
Not open for further replies.

delu0007

Programmer
Aug 28, 2001
26
US
I am trying to create a report that combines 4 tables from a single database. This database can be either MS Access or MS SQL Server. I chose the Active Data Driver in an attempt to have only one version of the report that I can use against either type of database. The report will be viewed in both a VB application as well as an ASP project.

The tables are related as follows:

{General Information} - Unlinked, fields are displayed in the page header only.

{Header Information} - One to one relationship with {System Equipment}.

{System Equipment} - One to many relationship with {System Data} and one to many relationship with {System Range}.

{System Data} - Many to one relationship with {System Equipment}.

{System Range} - Many to one relationship with {System Equipment}.

I originally had created a report with the DAO driver for Access only and the three system tables were linked by an ID field that exists in all three (There was a second ID field that linked {System Equipment} to {Header Information}). One pointer from {System Equipment} to {System Data}, and one pointer from {System Equipment} to {System Range}. This report worked great. I have failed so far trying to duplicate this relationship as a SQL query string.

Does anyone have a suggestion?
 
This SQL string is stored in the control source of your access report. Just copy and paste it into your crystal report and make the appropriate changes for the resource changes (may or may not be required). If you have your report liinked to a query go to the SQL view of the query and copy it from there. Be sure to add your database to your crystal report before pasting your SQL statement into your report as it may give you a hard time if it doesn't what tables you are talking about.
 
"Control source"? What exactly is the control source? The original report was created off of Access tables using the "Find database file" method of accessing the data. The dll it uses is PDBDAO.dll (MS DAO).

The report I am trying to create is Active Data on a SQL Server Database.
 
Because you have multiple tables, you will need to re-create the report using the Active Data Driver, or a TTX file that lists the files that you need.

You will link the tables in the application when you build the recordset, and pass the recordset to the report as one table. At that point the report won't care where the data is coming from.

If it is the SQL that is the problem, connect a new report to the SQL server and then connect the tables like you did with DAO in the visual linking expert. Then use Database - Show SQL Query to see a workable version of the SQL. Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top