Type Mismatch Error 13 
Author Message
 Type Mismatch Error 13

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



Sat, 02 Jun 2001 03:00:00 GMT  
 Type Mismatch Error 13
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


Quote:
>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



Sun, 03 Jun 2001 03:00:00 GMT  
 Type Mismatch Error 13
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



Mon, 04 Jun 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Type Mismatch Error 13

2. Using CurrentDB() receives Type Mismatch Error 13

3. Type mismatch error 13?

4. Type Mismatch error 13

5. Help!!! Please, Type Mismatch error 13

6. Type mismatch error 13?

7. Passing a Recordset to function gives Type mismatch (error 13)

8. Worked fine yesterday, today I get Error 13 Type Mismatch errors

9. Error 13: Type Mismatch error

10. Type Mismatch Run-Time error 13

11. type mismatch error '13'????

12. Type mismatch, run-time error #13

 

 
Powered by phpBB® Forum Software