I have used the Package & Deployment Wizard to put my Visual Basic Program on CD, I then copied over my database 'calculations.mdb' onto the cd also so that the VB program can access the database when installed on another PC. However, the program still searches the same path as it does on my computer when trying to open the database whereas i would obviously like it to search for it wherever the user installs it. Is it possible to hardset this in my VB code? This is what it is set to at the moment:

conconnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
App.Path & "" & "calculations.mdb;Mode=Read|Write"

Does anyone know how I can adapt it? If not, is it possible to set it to search on the CD in the disk drive?(although this would be awkward as the user would have to keep the cd in there but better than nothing!)

When creating package of your application , you can add your file like VBRuntime OLE, any Activex ctrls, any dll. U can see Add button on the Right side. Use this and Add ur database.

In the installation Location of wizard dont forget to chrck the location is $AppPath this where ur Application indtsllation path. Now after installation ur db file automatically placed where ur application located.

conconnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
App.Path & "[B]\[/B]calculations.mdb;Mode=Read|Write"

Dont forget "\"

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.