Dll with Database Connections (altered)
i tried to make dll with database connection but when i tried to create object of that dll class. i get an error in
The code in dll class(named cusotmer) is
Public rs As Recordset
Public name As String
Private Sub Class_Initialize()
rs.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\Nwind.mdb;Persist Security Info=False"
Set rs = New Recordset
rs.Open "select * from customers", , adOpenKeyset, adLockOptimistic
End Sub
Public Sub Class_Terminate()
rs.Close
Set rs = Nothing
End Sub
the reference is made and then i created an object
Private Sub Command1_Click()
Dim test As Customer
****Set test = New Customer
MsgBox test.Customerid
end sub
gives an error 91
please check this and for reference see the com tutorial part 3
CUSTOMER IS THE CLASS NAME not northwind
heloo friends
sorry i wrote wrong name.. but the class in dll is customer and project is northwind. same like the tutorial at vb-world.com part 3.. i typed as it is.. but not working
all reference is made.