I am using the Crystl32.ocx to connect to MS Access. This works OK providing the DSN has the full database path specified. However I should be able to you the default DSN ("MS Access Database", that gets installed with office, and pass the path of the database through in the vb code.
I have downloaded the "logon_ocx.pdf" from the Crystal web site and tried everything that they suggest to pass the data path to Crystal, but can't get it to work. Below is some of the code used, plus some things that I have tried. I would be grateful for any help.
This Works
----------
DBPath = App.Path
If Right(DBPath, 1) <> "\" Then DBPath = DBPath _
& "\" 'Database path = current path
CR1.ReportFileName = DBPath & "MainPrint.rpt"
CR1.Connect = "DSN=CustomerReturns"
CR1.Action = 1
This Should Work
----------------
This works (with CustomerReturns DSN pointing to the right database.
You should be able to replace line
CR1.Connect = "DSN=CustomerReturns" with
CR1.Connect = "DSN=MS Access Database;UID=Admin; _
PWD=;DBQ=<CRWDC>Database=C:\CustRet.mdb"
I have tried various different methods of this command plus the Datafiles(x) command but I can't get it to work.
Please Help!!!
I have downloaded the "logon_ocx.pdf" from the Crystal web site and tried everything that they suggest to pass the data path to Crystal, but can't get it to work. Below is some of the code used, plus some things that I have tried. I would be grateful for any help.
This Works
----------
DBPath = App.Path
If Right(DBPath, 1) <> "\" Then DBPath = DBPath _
& "\" 'Database path = current path
CR1.ReportFileName = DBPath & "MainPrint.rpt"
CR1.Connect = "DSN=CustomerReturns"
CR1.Action = 1
This Should Work
----------------
This works (with CustomerReturns DSN pointing to the right database.
You should be able to replace line
CR1.Connect = "DSN=CustomerReturns" with
CR1.Connect = "DSN=MS Access Database;UID=Admin; _
PWD=;DBQ=<CRWDC>Database=C:\CustRet.mdb"
I have tried various different methods of this command plus the Datafiles(x) command but I can't get it to work.
Please Help!!!