Dabase Connection???

01-09-2004, 04:10 AM

I'm trying to get a connection to a Access database using code. I got some example from the Internet:
Why is it that Visual Basic does not want me to Dim dbBIBI as "Database"?
Error: User-defined type not defined.

Dim dbBIBI As Database
Dim rsState As Recordset

Private Sub Form_Load()

Dim rsState As Recordset
Set dbBIBI = OpenDatabase("C:\PROGRAM _

SQLQuery = "SELECT * FROM Publishers WHERE _
State LIKE 'Pa*'"

Set rsState = dbBIBI.OpenRecordset(SQLQuery)

Do Until rsState.EOF = True
List1.AddItem rsState.Fields("State")

Set rsState = Nothing

End Sub

Dennis DVR
01-09-2004, 04:22 AM
you need to add a microsoft DAO object on your reference object go to the project menu and select References and look for Microsoft DAO Object.

01-09-2004, 04:25 AM
Thanks so much!

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum