Results 1 to 5 of 5

Thread: [RESOLVED] DB hardcoded?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2006
    Posts
    30

    Resolved [RESOLVED] DB hardcoded?

    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?

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: DB hardcoded?

    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.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Mar 2006
    Posts
    30

    Re: DB hardcoded?

    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

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: DB hardcoded?

    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.

  5. #5
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: [RESOLVED] DB hardcoded?

    huhhuh,

    Why not just post your connection string and let someone look at it. It will be solved very quickly that way...
    Last edited by randem; Mar 24th, 2006 at 04:43 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width