|
-
Nov 12th, 2002, 04:36 PM
#1
Thread Starter
New Member
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
Last edited by mirghouse; Nov 14th, 2002 at 07:33 AM.
-
Nov 12th, 2002, 08:51 PM
#2
Member
More please
What is the actual error message. It could be something as simple as simple as checking that the Customers class has been added to the project references .
You better give more details.
-
Nov 14th, 2002, 04:35 AM
#3
PowerPoster
What is a customer? Is it the class name?
-
Nov 14th, 2002, 07:31 AM
#4
Thread Starter
New Member
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.
-
Nov 14th, 2002, 07:44 AM
#5
PowerPoster
Which tutorial are you talking about, and can you upload your project after zipping it?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|