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/DAO report, movable source - Connect??

Status
Not open for further replies.

DimWit

Programmer
Dec 31, 2000
2
US
CR 7, VB6, new to CR programming.

I'm developing an app for which I want to include basic reporting. The app includes a simple "flat file" Access97 database. The end-user will be able to site the mdb file at will, but will have to inform the app of its location and that info is stored in an application-level variable.

I created a form in the CR IDE specifying "Active Data" and a DAO connection (I'm using DAO in the project since DAO is still faster than ADO for accessing Jet db's). I'm not using OBDC.

I've developed two different reporting solutions, one using the CRPE Automation Server and one using the OCX (after I was stymied with CRPE).

Using either method (but the OCX now preferred), how can I point the report to a variable data source.

report.database.tables("table").SetDataSource only appears to accept a recordset as the datasource (which I'd prefer to avoid).

OCX.DataFiles and
OCX.DataSource don't work for me -- even when I add a data control and reference it with DataSource.

Any help you could provide would be greatly appreciated.

TIA
John
DimWit as Formless
 
Never mind.

I created another report using "Data Source" instead of "Active Data" in the data source scroll box. Creating the report this way makes it possible to use the .DataFiles() property of the OCX.

Sorry for the confusion.

DimWit as Enlightened
 
To get around this in the past, I have always had two database. One is installed on the client machine in, say, C:\program files\myapp and another can reside anywhere on the network. In the client database I have linked tables to the "real" database. Then, all of my crystal reports are based in the same folder as the client database and I set the data source (in Crystal Reports) of the reports to "database is in the same location" (don't quite remember the exact place, but I think it is in "Set Database Location" - there is a button to say "same as report", or something like that).

Then, when the "real" database is moved, and selected through the application, all you have to do is reset the links on the tables in the client database (which you can do in DAO).
Simon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top