|
-
Apr 18th, 2006, 12:32 AM
#1
Thread Starter
Hyperactive Member
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...
-
Apr 18th, 2006, 03:14 AM
#2
Addicted Member
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
-
Apr 18th, 2006, 03:35 AM
#3
Frenzied Member
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.
On error goto Trap
Trap:
in case of emergency, drop the case...
****************************************
If this post has been resolved. Please mark it as "Resolved" by going through the "Thread Tools" above and clicking on the "Mark Thread Resolved " option. if a post is helpful to you, Please Rate it by clicking on the Rate link right below the avatar
-
Apr 18th, 2006, 08:29 PM
#4
Member
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
-
Apr 18th, 2006, 08:50 PM
#5
Thread Starter
Hyperactive Member
Re: Connection for Data Report... Help please
 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
-
Apr 19th, 2006, 06:56 AM
#6
Re: Connection for Data Report... Help please
Moved to reporting section
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
|