Results 1 to 2 of 2

Thread: ADO Connection for DLL's

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2000
    Posts
    93

    ADO Connection for DLL's

    I have a large application that has begun to get to cumbersome to manage as a single project. I want to spawn it off into ActiveX dll's to be more OOP so that it can be a better base for future development and to be easier to maintain.

    That program uses ADO to connect to a backend MS-SQL database. Currently when the user launches the program and logs in, a global connection is opened to the MS-SQL database and remains open for the duration of the application. This global connection is used for all recordsets created during the life of the application.

    When I split the application out into dll's I would like to be able to create a similar connection which is available to the recordsets across all the dll's. This is so that I do not create multiple connections to MS-SQL and therefore run into CAL problems.

    Can anyone offer any advice on how best to do this?

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    I would recommend not leaving the connection open and use disconnected recordsets, but if you want to share the connection then you can have 1 main connection in the app and then set any objects to use that same one:
    VB Code:
    1. 'in app
    2. Public gConnect as New ADODB.Connection
    3.  
    4. 'in app set objects
    5. Set Object1.Connection=gConnect
    6. Set Object2.Connection=gConnect
    7. Set Object3.Connection=gConnect

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