Results 1 to 2 of 2

Thread: Single Connection Object

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2002
    Posts
    7

    Exclamation Single Connection Object

    BACKGROUND:
    I have an existing VB application that is a FAT client with all the GUI, Business and Data logic inter-mixed. This application is a simple client server application (the server is SQL 2000).

    I want to break up the application so that the GUI code is seperate from the Business Logic which is seperate from the Data Access logic.

    I have created an ActiveX DLL to house all the data logic. This DLL will exist on the client.


    QUESTION:
    I would like to create just one connection object when the client is started and use this conneciton object for all database calls.

    Dim objCon As ADODB.Connection

    In other words, I do not want to create a connection object each time I call one of the data service objects.

    All of the data service object would make use of this one connection object.

    I have not been able to figure out a way to make this work otherr than declaring a connection object in the main program and passing it into the Data Access object calls.


    Users.GetUsersBySite(objCon,SiteID)

    I would like to avoid having to pass in the connection object to every method I call.

    Any ideas?

    I have looked into making a Persistable cConnection class but I have not been able to get this to work.

    Thanks.

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    You might want to try the General VB or Database Development forums.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

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