Results 1 to 5 of 5

Thread: Connection String problem

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2001
    Posts
    85

    Angry Connection String problem

    I thought that when I used this code ...

    dePenlogs.Connections("cnlogs").ConnectionString = App.Path + "\" + ("Temp.mdb")


    When the app would be installed on the users machine it would find the database in the apps path but it does not. It tries to find the the database in the same directory as on my machine where the app was written WHY????

    All I am trying to do is have a connection to the database without going through ODBC ( the only way I have ever done it). How do I do this (I am sure very simple) thing.???

    PS. May the US find the #@S H%L#S Responible for the WTC bombing and blow them away aswell!!!!!!!!!

  2. #2
    PowerPoster Beacon's Avatar
    Join Date
    Jan 2001
    Location
    Pub Floor
    Posts
    3,188
    try:

    dePenlogs.Connections("cnlogs").ConnectionString = App.Path & "\" & "Temp.mdb"

    else

    What is cnlogs?

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jul 2001
    Posts
    85

    Question It works fine

    No it works fine on my PC. Ok I am writting my project in this directory. C:\Projects\MyProject

    Now when I install the app on another pc and try to run it. It gives me an error somthing like:

    Cannot find database in C:\Projects\MyProject

    Now I thought that by using the App.path statement, the project would look for the database in the app directory, which would be
    C:\ProgramFiles\MyProject

  4. #4
    PowerPoster Beacon's Avatar
    Join Date
    Jan 2001
    Location
    Pub Floor
    Posts
    3,188
    yeah i agree with gab!

    Coz app.path should do it that way!

    or perhaps:

    dePenlogs.Connections "cnlogs").ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\pathhere.mdb"

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Jul 2001
    Posts
    85

    Talking May be right on that one

    I think you may be right on what you say, I do have another ActiveX ado control on one of my forms, with I set the Connection String to the DataEnviroment connection through code, but i did see that it was hardcoded in the properties on that control, I will let you know when I P&D it again

    Thanks

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