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!

Change Table Name at Run Time

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I'm using Crystal reports version 4.5. I'm creating a temporary table on an Access database to hold report data, before printing it with Crystal. The temporary table's name will be suffixed with the user's logon-id, i.e. the name of the table will not be known until run-time, although its structure will be the same as when the report was saved.

Can I tell Crystal Reports the name of the table at run-time?
 
jmcrewe: Not sure exactly what syntax v4.5 supports (before my time) but the current SetLogonInfo method supports the change of table name so you might try that David C. Monks
david.monks@chase-international.com
Accredited Seagate Enterprise Partner
 
jmcrewe,

I believe you will need the Datafiles property. This is part of the entry in the developer's help file:


DataFiles Property, Crystal Custom Control

Description
Specifies the location of the database files or tables used in the report.

Usage
[form.]Report.DataFiles(ArrayIndex)[= Location$] Ken Hamady
Crystal Reports Training and a
Quick Reference Guide to VB/Crystal
 
Thanks, but I can only get the DataFiles property to change the name of the database. Is it possible to change the name of the table within the same database e.g. change it from "TempRepTable_User1" to "TempRepTable_User2" ?
If so, what would the syntax be?
 
Thanks, but I can only get the DataFiles property to change the name of the database. Is it possible to change the name of the table within the same database, e.g. from 'TempRepTable_User1' to 'TempRepTable_User2' ?
If so, what would be the syntax?
 
I am not sure, since I have a newer version.

Someone else here might know. From the developers help for V4.5 this is supposed to allow the change of table, but they don't give an example. You might want to check the developers help file (developr.hlp) of your version to see if it is any better.

A guess. It might follow the "Set Location" pattern of using the MDB!tablename or something like that.

Another guess, you might not be able to. I created a report in CR4.5 and I could change the MDB is the design environemt using "Set Location", but I could not see a way to select a differnt table in the same MDB. This was in the report designer itself, so if the option isn't there, it might not be in the OCX.

Ken Hamady
Crystal Reports Training and a
Quick Reference Guide to VB/Crystal
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top