ReaperFett
04-13-2004, 04:15 AM
Okay, I have started a page where I need to access my MS Access Database. The page starts:
Dim MyDataBase As Database
Dim rs As Recordset
Private Sub Form_Load()
Set MyDataBase = OpenDatabase(App.Path & "\Library.mdb")
Set rs = MyDataBase.OpenRecordset("Password")
End Sub
In the same directory as this VB is saved I have Library.mdb. Inside is a table called Password, which has a single field inside called PW, which is made to be the Primary Key.
When I try to run this, I get the error message
Run-time erroer '13':
Type mismatch
When I press debug, it highlights "Set rs = MyDataBase.OpenRecordset("Password")".
Does anyone know what is going wrong?
Dim MyDataBase As Database
Dim rs As Recordset
Private Sub Form_Load()
Set MyDataBase = OpenDatabase(App.Path & "\Library.mdb")
Set rs = MyDataBase.OpenRecordset("Password")
End Sub
In the same directory as this VB is saved I have Library.mdb. Inside is a table called Password, which has a single field inside called PW, which is made to be the Primary Key.
When I try to run this, I get the error message
Run-time erroer '13':
Type mismatch
When I press debug, it highlights "Set rs = MyDataBase.OpenRecordset("Password")".
Does anyone know what is going wrong?