PDA

Click to See Complete Forum and Search --> : Data Class DLL


RManzione
Oct 22nd, 2000, 05:04 AM
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!

monte96
Oct 22nd, 2000, 04:52 PM
Use properties.


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:


Dim MyObj as New MyObject.Class

MyObj.ConnectionString = "connectionstring"
MyObj.OpenConnection

RManzione
Oct 22nd, 2000, 06:07 PM
Monte,

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

Rich