|
-
Jun 23rd, 2000, 07:08 PM
#1
Thread Starter
Junior Member
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
-
Jun 24th, 2000, 09:19 AM
#2
Junior Member
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
-
Jun 24th, 2000, 07:53 PM
#3
Thread Starter
Junior Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|