changing the location of the database
Hi
I have a project VB6 - crystal report 9-Access Database.The database of the report was located on "C:\Employee\Employee.mdb" but the location of the database was changed into "\\PC5\Employee\Employee.mdb".How can I change the location of the database without rewriting the report?
thanks
Re: changing the location of the database
simple way is that make the report using the dsn.. so where ur database the dsn automatically take the database...
batter way is that if you are using the server client method then use the database on the server.. and make the dsn for every pc...
Re: changing the location of the database
Quote:
simple way is that make the report using the dsn..
where is the dsn?Can you explain more your method?
thanks
Re: changing the location of the database
r u adding the database in the crystal report using the dsn or collecting the database using drive path
Re: changing the location of the database
I am collecting the database using drive path
Re: changing the location of the database
Re: changing the location of the database
pnish I am using VB6 with CR9.
Also I didn't catch what do u mean by n
VB Code:
Set crDB = Report.Database.Tables(1)
Set crDB = Report.Database.Tables(2)
Set crDB = Report.Database.Tables(3) ..... and so on
Re: changing the location of the database
VB Code:
objReport.Database.Tables(1).Location = "path & name of your database"
If your report references more than 1 table, you need to put that line of code for each one. For example if your report referenced a table called 'Cust Names' in the database 'C:\Customers.mdb' and another table called 'Invoices' in the database 'C:\Sales.mdb' your code would look like this
VB Code:
objReport.Database.Tables([color=red]1[/color]).Location = "C:\Customers.mdb"
objReport.Database.Tables([color=red]2[/color]).Location = "C:\Sales.mdb"
The numbers in red are the table ordinals, ie they represent in which order the tables appear in your report file. You can determine this by selecting Database Expert from the Database menu in Crystal. On the right hand side all the tables used in the report will be listed, the first table is '1', the second is '2' and so on.