Results 1 to 3 of 3

Thread: Data Class DLL

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2000
    Location
    New York City
    Posts
    73

    Hi,

    I've created a class dll to access data in SQL server. Right now, the connection is hard coded in the class initialize event. I can't seem to figure out how to pass connection values to the DLL at run time from the main program rather than having them hard coded in the DLL. Anyone have any ideas??

    Thanks!
    Rich

  2. #2
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    Use properties.

    Code:
    Public Property Get ConnectionString() As String
         ConnectionString = conn.ConnectionString
    End Property
    
    Public Property Let ConnectionString(strNewString As String)
         conn.ConnectionString = strNewString
    End Property
    In your calling code:

    Code:
    Dim MyObj as New MyObject.Class
    
    MyObj.ConnectionString = "connectionstring"
    MyObj.OpenConnection
    oOOo--oOOo
    __/\/\onte96
    oOOo--oOOo
    Senior Programmer/Analyst
    MCP
    [email protected]
    [email protected]


    Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Oct 2000
    Location
    New York City
    Posts
    73
    Monte,

    Worked out great!!! Thanks a million for your help!!

    Rich
    Rich

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