-
December 29th, 2009, 10:02 AM
#1
Conecting tables in different Databases
Hi to everyone.
Does anyone remember VB5 and Crystal Reports 4.6.1.?
I created a report which invokes two tables that are in different Access Databases which are password protected.
The thing is that I Can´t find the way to point to the Databases when they are in other location than the used when the report was created.
I already try this but no success…
FormX.Cr1.DataFiles(0) = DbPath1 & "db1.mdb"
FormX.Cr1.DataFiles(1) = DbPath2 & "db2.mdb"
Your help will be much appreciated
Thanks in advance.
-
December 29th, 2009, 12:40 PM
#2
Re: Conecting tables in different Databases
Are You sure that DbPath1 and DbPath2 ends with a '\'
-
December 29th, 2009, 08:08 PM
#3
Re: Conecting tables in different Databases
Originally Posted by jggtz
Are You sure that DbPath1 and DbPath2 ends with a '\'
Hi jggtz , tahnks for you answer...
Yes, in fact
DbPath1 is C:\Proyectos\CopyJet2\Servicio\
and
DbPath2 is C:\Proyectos\CopyJet2\Factur 2.5.5\
-
December 30th, 2009, 11:42 AM
#4
Re: Conecting tables in different Databases
In my opinion the syntax is correct...
Check if you Save Data With Report,
Also, may you post your code (Printing routine) I would like to see how you are handling the password protection
-
December 31st, 2009, 08:13 AM
#5
Re: Conecting tables in different Databases
Thanks jggtz...
This is the code... the databases are now, Not password protected, so that´s not an issue for this problem.
With CR
For X = 0 To 10
.Formulas(X) = ""
Next X
.DiscardSavedData = True
.ReportFileName = "C:\Proyectos\CopyJet2\Servicio\rptSolicitudPartesPorReporte.rpt"
.DataFiles(0) = "C:\Proyectos\CopyJet2\Servicio\Servicio.mdb"
.DataFiles(1) = "C:\Proyectos\CopyJet2\Factur 2.5.5\Sifacbas.mdb"
.Action = 1
End With
I´m also observing the order in which databases must be asigned in the DataFiles array.
Thank you very much. I hope this can lead you to a clue
-
December 31st, 2009, 02:00 PM
#6
Re: Conecting tables in different Databases
Syntax seems ok
Only one thing ... Change the directory name "Factur 2.5.5" removing blanks and/or periods and give a try...
-
January 2nd, 2010, 10:15 AM
#7
Re: Conecting tables in different Databases
HI jggtz....
At the end I found the key of this matter...
What happens is that in the DataFiles array, is created an entry of the database path for each table in the report.
Since in the report of this case are used three tables of the "Servicio.mdb" database, and two tables of the "Sifacbas.mdb" database, the DataFiles array must be:
Cr1.DataFiles(0) = "C:\Proyectos\CopyJet2\Servicio\Servicio.mdb"
Cr1.DataFiles(1) = "C:\Proyectos\CopyJet2\Servicio\Servicio.mdb"
Cr1.DataFiles(2) = "C:\Proyectos\CopyJet2\Servicio\Servicio.mdb"
Cr1.DataFiles(3) = "C:\Proyectos\CopyJet2\Factur 2.5.5\Sifacbas.mdb"
Cr1.DataFiles(4) = "C:\Proyectos\CopyJet2\Factur 2.5.5\Sifacbas.mdb"
And with this the case is solved
jggtz, I really appreciate your kind attention to this problem.
Have a great year!!!
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
|