Results 1 to 9 of 9

Thread: multiple conn? ( resolved)

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2004
    Posts
    908

    multiple conn? ( resolved)

    can i open another connection within an open close conn?
    Last edited by Goh; Feb 17th, 2004 at 02:49 AM.

  2. #2
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629
    Reuse a closed connection? Yup you can, just change whatever property needs to be changed and .Open the connection.

  3. #3
    PowerPoster
    Join Date
    Nov 2001
    Location
    Trying to reach and stay in the cloud
    Posts
    2,089

    Re: multiple conn?

    Originally posted by Goh
    can i open another connection within an open close conn?
    What do you mean by a open close conn?

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2004
    Posts
    908
    wat i mean is within an open conn1(load_form) and close conn1(unload_form) ,in between i open a new conn2 ..is it ok?

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2004
    Posts
    908
    or can i reopen a conn (conn1) that is yet to close..?

  6. #6
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629
    Close it first before reopening

  7. #7

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2004
    Posts
    908
    then can i : open conn1(load_form) and close conn1(unload_form) in between i open a new conn2 ..is it ok?
    ie. 2 different conns..

  8. #8
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629
    if its 2 different connection objects then you can close open them independent of the status of the other.

  9. #9
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632
    There is no need for your connection to be constantly open.
    Open it, use it, then close it.

    In fact your recordsets, you don't even need a connection object.
    VB Code:
    1. Private Const CONN_STRING As String = 'your conn string to your DB
    2.  
    3. Dim adoRec As Recordset
    4.    Set adoRec = New Recordset
    5.    With adoRec
    6.       .Open "SELECT * FROM Users", CONN_STRING
    7.  
    8. 'blah blah blah

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