|
-
Aug 20th, 2006, 08:20 AM
#1
Thread Starter
Fanatic Member
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
-
Aug 20th, 2006, 10:46 AM
#2
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...
-
Aug 21st, 2006, 12:23 AM
#3
Thread Starter
Fanatic Member
Re: changing the location of the database
simple way is that make the report using the dsn..
where is the dsn?Can you explain more your method?
thanks
-
Aug 21st, 2006, 08:41 AM
#4
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
-
Aug 21st, 2006, 08:56 AM
#5
Thread Starter
Fanatic Member
Re: changing the location of the database
I am collecting the database using drive path
-
Aug 23rd, 2006, 03:31 AM
#6
Re: changing the location of the database
Pete
No trees were harmed in the making of this post, however a large number of electrons were greatly inconvenienced.
-
Aug 23rd, 2006, 03:44 AM
#7
Thread Starter
Fanatic Member
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
-
Aug 23rd, 2006, 05:34 PM
#8
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.
Pete
No trees were harmed in the making of this post, however a large number of electrons were greatly inconvenienced.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|