|
-
Jan 7th, 2007, 12:20 PM
#1
Thread Starter
New Member
[2005] Compile with .MDB File
Hello,
In one of my subs, I have the code:
VB Code:
Dim sConStr As String = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data " _
& "Source=data.mdb"
Fair enough, that works fine in Debug mode, but when I come to Publish the project, make the setup.exe file and run it, it says cannot fine data.mdb. How can I make it so that when you publish the project, the database file is included. Also, I have an image file which is uses in the project, so that would need to be included aswell.
Thanks for any help
-
Jan 7th, 2007, 01:22 PM
#2
Fanatic Member
Re: [2005] Compile with .MDB File
You need to add the full path name to the source.
VB Code:
Dim sConStr As String = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data " _
& "Source=C:\data.mdb"
-
Jan 7th, 2007, 03:02 PM
#3
Thread Starter
New Member
Re: [2005] Compile with .MDB File
What if the user's drive isn't C for example? Or they don't install it on their hard drive? Or I don't know what the full path would be? What must I do instead?
Thanks
-
Jan 7th, 2007, 04:33 PM
#4
Fanatic Member
Re: [2005] Compile with .MDB File
 Originally Posted by doof92
What if the user's drive isn't C for example? Or they don't install it on their hard drive? Or I don't know what the full path would be? What must I do instead?
Thanks
You can place the mdb file in the application path and use the following to find the mdb in the application folder.
VB Code:
Dim sConStr As String = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data " _
& "Source=" & Application.StartupPath & "\" & data.mdb"
If the mdb is not going to be on the end user's hard drive then you need to use the path the mdb on a server some place.
You should know exactly where the mdb is located, if you don't there is another logic problem.
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
|