-
Hi
I'm making for the first time an application, where i would like to use database, but I have a lot of problems.
First problem is, that when I write this:
Dim DB As Database
Dim RS As Recordset
Private Sub Form_Load()
Set DB = OpenDatabase(App.Path & "\generali.mdb")
Set RS = DB.OpenRecordset("Generali")
End Sub
I run the application, but there is a note saying "Type mismatch" and the line "Set RS = DB.OpenRecordset("Generali")" becomes yellow. What's wrong?
I would like also that DataCombo would display in a list the first field from a database.
Thanks.
Jure
-
Dim DB As Database
Dim RS As Recordset
Private Sub Form_Load()
Set DB = OpenDatabase(App.Path & "\generali.mdb")
Set RS = DB.OpenRecordset("Generali")
End Sub
Try changing the (App.Path & "\generali.mdb") to (App.Path & "/generali.mdb")and just make sure the recordset is correct
Let me know what happens!
Altecjjf
-
Answer
From MSDN Library:
If your project contains references to both the Data Access Objects (DAO) library and the ActiveX Data Objects (ADO) library, you may see multiple Recordset entries in the list box when you dimension the Recordset object. This error occurs when you list the ADO library with a higher priority than the DAO library in the References dialog box, regardless of which Recordset entry you select from the list box.
If you need only the DAO Recordset object, make sure that the reference for the DAO object library has a higher priority in the References dialog box, or clear the reference to Microsoft ActiveX Data Objects.
_______________________
And now it's working.
Jure