[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
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"
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? :p
Thanks
Re: [2005] Compile with .MDB File
Quote:
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? :p
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.