emvanlill
01-09-2004, 04:10 AM
Hi
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 _
FILES\VB98\BIBI.MDB")
SQLQuery = "SELECT * FROM Publishers WHERE _
State LIKE 'Pa*'"
Set rsState = dbBIBI.OpenRecordset(SQLQuery)
Do Until rsState.EOF = True
List1.AddItem rsState.Fields("State")
rsState.MoveNext
Loop
Set rsState = Nothing
End Sub
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 _
FILES\VB98\BIBI.MDB")
SQLQuery = "SELECT * FROM Publishers WHERE _
State LIKE 'Pa*'"
Set rsState = dbBIBI.OpenRecordset(SQLQuery)
Do Until rsState.EOF = True
List1.AddItem rsState.Fields("State")
rsState.MoveNext
Loop
Set rsState = Nothing
End Sub