Results 1 to 7 of 7

Thread: Database Project help needed

  1. #1
    Join Date
    Aug 2002
    Posts
    6,223
    Rep Power
    0

    Default Database Project help needed

    I have a program(me) connected to an Access database via ODBC32 using a DataEnvironment designer (deODBC) and connection (connODBC). User logs in before using programme works fine. This programme is to be used with multiple databases (log out from one and connect to another). Right now, the only way to switch database is to start the program again. The code I've used to do this does not work:
    --------------------------------------------------------
    Private Sub cmdChLocation_Click()

    deODBC.conODBC.Close
    deODBC.conODBC.ConnectionString = "Provider=MSDASQL.1;Persist Security Info=False;Mode=Read"
    deODBC.conODBC.Open

    End Sub
    ---------------------------------------------------------
    Any idea where I'm going wrong?

    Ramesh

  2. #2
    Join Date
    Jun 2003
    Posts
    159
    Rep Power
    0

    Default Re:Database Project help needed

    Your connection is still active. You need to disconnect.

  3. #3
    Join Date
    Feb 2003
    Posts
    3,184
    Rep Power
    0

    Default Re:Database Project help needed

    something like "deODBC.conODBC.Close"

  4. #4
    Join Date
    Aug 2002
    Posts
    6,223
    Rep Power
    0

    Default Re:Database Project help needed

    Quote Originally Posted by owen
    something like "deODBC.conODBC.Close"
    "deODBC.conODBC.Close" is the first statement. Anyway, since then my hard drive failed and that project no longer exists. I would still be interested in the method, if anyone has it....?

  5. #5
    Join Date
    Feb 2003
    Posts
    3,184
    Rep Power
    0

    Default Re:Database Project help needed

    go to ms 's site and search for a vb access dataaccess example it's the best way to get a kick start. (or use one of the sample that come with the app)

  6. #6
    Join Date
    May 2004
    Posts
    3
    Rep Power
    0

    Default Re:Database Project help needed

    Try setting deODBC.conODBC = nothing , and using the doevents command after each statement

    I'm guessing here - haven't tried used that control in a long time.

    (by the way I prefer binding through connection variables , not objects that use some connection - that way you don't have to depend less on somebody somehere not forgetting to do something for your program to work)

  7. #7
    Join Date
    Oct 2004
    Posts
    1
    Rep Power
    0

    Default Re: Database Project help needed

    Please send me a mail with correct prob.
    I think No need for u to close the Connection to the database.
    U can open connection to all the Databases at a time and maintain until end.
    Only thing is it will take a little time to get the updated data in the recordsets. After Update Pleasse give little time to querry the data fro the database.
    U can contact me through mail or contact me over phone 337 7322( i am in Kingston) or my mail id is ggottumukkala@yahoo.com

    all the best
    Gopal

    Quote Originally Posted by ramesh
    I have a program(me) connected to an Access database via ODBC32 using a DataEnvironment designer (deODBC) and connection (connODBC). User logs in before using programme works fine. This programme is to be used with multiple databases (log out from one and connect to another). Right now, the only way to switch database is to start the program again. The code I've used to do this does not work:
    --------------------------------------------------------
    Private Sub cmdChLocation_Click()

    deODBC.conODBC.Close
    deODBC.conODBC.ConnectionString = "Provider=MSDASQL.1;Persist Security Info=False;Mode=Read"
    deODBC.conODBC.Open

    End Sub
    ---------------------------------------------------------
    Any idea where I'm going wrong?

    Ramesh

Posting Permissions

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