Results 1 to 2 of 2
  1. #1
    New Lounger
    Join Date
    Jul 2002
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ADODB connection module (VB7)

    Hi,
    Does anyone know if it is possible to create an ADODB function within a module, rather than having to open a connection within each sub procedure every time you want to establish a connection with a database (preferably SQL or MSDE)? I've been trying and I haven't figured out how to return a connection object to the calling sub procedure. Any help would be much appreciated.
    Sue.

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: ADODB connection module (VB7)

    Seems you should be able to do it with a Public variable for your Connection object. If VB7 uses ByRef argument passing, you might also be able to do it by passing the variable as a parameter and operating directly on it, having the function simply return a success/failure boolean. Haven't tried this myself.

Posting Permissions

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