PDA

Click to See Complete Forum and Search --> : [RESOLVED] DB hardcoded?


huhhuh
Mar 23rd, 2006, 08:09 AM
I read and followed various faqs regarding deployment and everything works fine accept that the newly installed app will only access the database at the original pre-deployment location, not the new install folder. Don't the database connectionstrings get converted or modified after deployment? How can I get the app to access the database at the install folder post deployment?

Hack
Mar 23rd, 2006, 08:18 AM
My guess is that the connection string contains a hard coded path rather than App.Path.

If it is indeed hardcoded, then you have only two options:

Go back to the source and change to using App.Path/recompile/redistribute

Have your installation package create the exact same folder structure as the hardcoded path in the application and put your database there.

huhhuh
Mar 23rd, 2006, 08:28 AM
When you say hardcoded do you mean like when I declare

Dim conn1 as New OleDbConnection
conn1.ConnectionString=".......

What about those where I create using drag and drop method, where I use the popup to create a new connection? Are those considered hardcoded as well?

What is this App.Path thingy? New to programming sry

Hack
Mar 23rd, 2006, 08:51 AM
By hardcoded I mean:

"c:\foldername\foldername\foldername\database name.mdb"

It would appear as though the actual names of the folders have been included in the connection string. If those folders do not exist on the target machine, you will get an error and your database connection will fail.

App.Path means the "path of the application". In other words, the folder in which the .Exe file resides. If you use App.Path in your connection string, then your connection string will look for the database in the same place as your program is.

randem
Mar 23rd, 2006, 02:54 PM
huhhuh,

Why not just post your connection string and let someone look at it. It will be solved very quickly that way...