2 Attachment(s)
Connection for Data Report... Help please
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... :)
Re: Connection for Data Report... Help please
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
Re: Connection for Data Report... Help please
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.
Re: Connection for Data Report... Help please
I have to agree it's a path problem. Try the App.Path something like...
Code:
connectionName.ConnectionString = _
"Provider=Microsoft.Jet.OLEDB.4.0;" &_
"Data Source=" & App.Path & "\databaseName.mdb"
Steve
Re: Connection for Data Report... Help please
Quote:
Originally Posted by KinkyWiz
I have to agree it's a path problem. Try the App.Path something like...
Code:
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?
VB Code:
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
Re: Connection for Data Report... Help please
Moved to reporting section