Click to See Complete Forum and Search --> : Connection for Data Report... Help please
weisi
Apr 18th, 2006, 12:32 AM
Im using Data Connection and Data Report for reporting. I having this problem whenever I install the application in a new system into a different folder different from my original path where the database is (see attached "original connection"). An error (see attached "error") will be shown for me to type in my new path for my database whenever I click on the show report button. Is there anyway that Im able to solve this, so I do not have to keep typing the new path for the database. Please advice and thanks in advance... :)
iehjsucker
Apr 18th, 2006, 03:14 AM
in your code, you can set the connection to somewhat like this:
app.path & "\data\x.mdb"
this will get the path of your application and not a static path as to what you may have done
d3gerald
Apr 18th, 2006, 03:35 AM
could you post some code
are you using adodb object or ded. if youre using adodb, then its a lot easier to solve this prob by using the sulution in post no 2.
but if youre using ded, then its a lot more complicated thing.
KinkyWiz
Apr 18th, 2006, 08:29 PM
I have to agree it's a path problem. Try the App.Path something like...
connectionName.ConnectionString = _
"Provider=Microsoft.Jet.OLEDB.4.0;" &_
"Data Source=" & App.Path & "\databaseName.mdb"
Steve
weisi
Apr 18th, 2006, 08:50 PM
I have to agree it's a path problem. Try the App.Path something like...
connectionName.ConnectionString = _
"Provider=Microsoft.Jet.OLEDB.4.0;" &_
"Data Source=" & App.Path & "\databaseName.mdb"
Steve
Where do I place these code? In the dataenvironment's connection? When I dbl click on the connection1?
Private Sub Connection1_InfoMessage(ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pConnection As ADODB.Connection)
connectionName.ConnectionString = _
"Provider=Microsoft.Jet.OLEDB.4.0;" &_
"Data Source=" & App.Path & "\databaseName.mdb"
End Sub
Hack
Apr 19th, 2006, 06:56 AM
Moved to reporting section
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.