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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change Text file Datasource at Runtime

Status
Not open for further replies.

TJRogers

Technical User
Mar 27, 2009
3
GB
We currently use a very old DOS based database system which holds all our customer contact details. At set periods we export from that system a csv file and name it by the date so we keep each lot of data exported.
E.g. "PO14 - 27.03.2009.csv".
I have created a semi-generic Visual Basic Application that populates 2 selection boxes, 1 box with the available reports selectable and the second box with the CSV data files available.
When the user hits the preview button I set the report viewer to use the report selected, but when the code ("Report.Database.Tables(1).Location = vFileName") executes it produces an error.
vFilename is "F:\promo\export\PO13 - 21.02.2008".
The error number is -2147189180 and description is The table '20022009_CSV' could not be found.
The table mentioned in the error description is the file I originally used when designing the report.

I understand I need to replace the datasource before the report executes, but the fields in the report are binded to that data source. I have an idea about creating a new data source and then re-mapping the existing fields to the new data source and then deleting the old one, but am not this technical with Crystal to understand how to do it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top