Results 1 to 5 of 5

Thread: Dll with Database Connections (altered)

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2002
    Posts
    2

    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.

  2. #2
    Member
    Join Date
    Oct 2001
    Posts
    51

    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.

  3. #3
    PowerPoster
    Join Date
    Aug 2000
    Location
    India
    Posts
    2,288
    What is a customer? Is it the class name?

  4. #4

    Thread Starter
    New Member
    Join Date
    Nov 2002
    Posts
    2

    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.

  5. #5
    PowerPoster
    Join Date
    Aug 2000
    Location
    India
    Posts
    2,288
    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
  •  



Click Here to Expand Forum to Full Width