Changing Database at Runtime-Urgent
Hi,
I am using VB 6.0(ADO Method)/MS-Access, Crystal 8.5 (through Active X Control i.e Crystl32.OCX) and create reports through DSN. As of now I have worked on 1 Database and bind all the Reports at design to DSN and DSN is connected to the Database.
Now I have 4 - 5 Database or databases may increase as per the need. Tables in all the Databases are same only Data is different but Reports for all the Database is same.
When VB Application starts users is asked to select Database. All the Data and records goes to selected Database. I want that when I run the report. Reports should retrieve the Records from selected Database Only. Whenever Database is changed Reports should retrieve the data from the selected Database.
Pls advise me How Database Can be changed at run time or how to bind reports. Actually, This practice is done in Multi-Company System. Suppose, there is Payroll Package which keeps records of Head office and 3 Branches. So, 4 Databases will be created or when any new branch open Database may increase but Reports will be same for all.
Kindly help me.
Regards,
Sohrab
[email protected]
Changing Database at Runtime-Urgent
Changing Database at Runtime
Mr. Dave,
Thanks for your reply,
Boss I did not understand about All ODBC Connection. Right now I have 1 ODBC connection and that is SYSTEM DSN.
[form.]Report.Connect = "DataSourceName";"UserID";"Password";"DatabaseName"
(only need to uses DatabaseName above if your server uses the database concept)
Report.SetTableLocation "databasename.mdb", "TableName", "Buffer"
(usually can leave Buffer as empty string)
Iused this code but I'm uanble to find Report.SetTableLocation Property.
I'm using Crystal Control Object (Crystl32.OCX) where .SetTableLocation Property is not available.
In All the Database Schema and Fileds everything is same only Database Names are different b'coz data save in different databases.
Pls do something. I'll be highly grateful to you.
Regards,
Sohrab