Thanks for the response... my problem is just my newness to this
language... i had ADO objects referenced along with DAO... after i got
rid of the ADO reference everything worked fine...
I have a lot to learn!!!!
Thanks
don
On Wed, 16 Dec 1998 17:57:37 -0700, "Rick Cardarelle"
Quote:
>What object do you have rsClass set up as? Here is an example:
>Dim dbClass as DAO.Recordset
>Dim rsClass as DAO.Recordset
>Set dbClass = DAO.DBEngine.OpenDatabase("GradeBook.mdb")
>Set rsClass = dbClass.OpenRecordset("SELECT [Class Name] FROM Class",
>dbOpenDynaset)
>' ** Notice Class Name is in brackets []. This is due to the space...
>With rsClass
> .MoveLast
> .MoveFirst
> Msgbox .RecordCount & " Records"
> .Close
>End With
>dbClass.Close
>Set rsClass = Nothing
>Set dbClass = Nothing
>Rick
>>Using VB 6.0 Pro
>>I have Access Database GradeBook.mdb
>>One table "Class"
>>with one Field "Class Name"
>>The following is my syntax for access the database and when i run this
>>it gives me an erro 13 type mismatch on the "Set rsClass" statement.
>>The line is returning nothing to the rsClass. Why?
>>What am i doing wrong? I am new to VB, so obviously it must be
>>something simple!
>>all help will be greatly appreciated
>>Thanks Don
>>Option Explicit
>>Dim dbGradeBook As Database
>>Dim rsClass As Recordset
>>Private Sub Form_Load()
>> Dim sDBLocation As String
>> sDBLocation = App.Path & "\GradeBook.mdb"
>> Set dbGradeBook = OpenDatabase(sDBLocation)
>> Set rsClass = dbGradeBook.OpenRecordset("Class", dbOpenDynaset)
>> Call ShowFields
>>End Sub