ACC2000:Run Time Error '13': Type Mismatch 
Author Message
 ACC2000:Run Time Error '13': Type Mismatch

Why am I getting the error "Run Time Error '13': Type Mismatch", in Access
2000 when I hit the dbs.OpenRecordset line?  Sample code is below:

Dim dbs As Database, rst As Recordset
Dim strSQL As String

' Return reference to current database.
Set dbs = CurrentDb
strSQL = "BackupCRP_F47047"
Set rst = dbs.OpenRecordset(strSQL, dbOpenDynaset)
rst.MoveLast
Debug.Print rst.RecordCount
rst.Close
Set dbs = Nothing



Sun, 14 Sep 2003 00:50:14 GMT  
 ACC2000:Run Time Error '13': Type Mismatch
use rst As DAO.Recordset
(probably you have also reference to ADO)

Alex


Quote:
> Why am I getting the error "Run Time Error '13': Type Mismatch", in Access
> 2000 when I hit the dbs.OpenRecordset line?  Sample code is below:

> Dim dbs As Database, rst As Recordset
> Dim strSQL As String

> ' Return reference to current database.
> Set dbs = CurrentDb
> strSQL = "BackupCRP_F47047"
> Set rst = dbs.OpenRecordset(strSQL, dbOpenDynaset)
> rst.MoveLast
> Debug.Print rst.RecordCount
> rst.Close
> Set dbs = Nothing



Sun, 14 Sep 2003 03:41:54 GMT  
 ACC2000:Run Time Error '13': Type Mismatch

Quote:

>Why am I getting the error "Run Time Error '13': Type Mismatch", in Access
>2000 when I hit the dbs.OpenRecordset line?  Sample code is below:

>Dim dbs As Database, rst As Recordset
>Dim strSQL As String

>' Return reference to current database.
>Set dbs = CurrentDb
>strSQL = "BackupCRP_F47047"
>Set rst = dbs.OpenRecordset(strSQL, dbOpenDynaset)
>rst.MoveLast
>Debug.Print rst.RecordCount
>rst.Close
>Set dbs = Nothing

Tony

As you are running A2k, you must have DAO 3.6 referenced (otherwise it would
fail on the line 'Dim dbs As Database'), but you probably also have ADO still
referenced. A Recordset Object appears in both ADO and DAO Object libraries,
with different properties, and you must disambiguate any such object so that
the correct one is used (otherwise Access uses the order of references).
Therefore:

Dim rsDAO As DAO.Recordset
Dim rsADO As ADODB.Recordset

Jon

Access tips & tricks - http://www.applecore99.com
Microsoft Access webring -
http://nav.webring.yahoo.com/hub?ring=microsoftaccess



Sun, 14 Sep 2003 05:21:36 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Run -time error '13' Type Mismatch

2. Run-time error '13': Type mismatch

3. Run-time error '13': Type mismatch

4. Run-time error '13': Type mismatch

5. type mismatch error '13'????

6. Urgent: runtime error '13' type mismatch

7. runtimer error '13' type mismatch

8. Type Mismatch Run-Time error 13

9. Type mismatch, run-time error #13

10. Run Time Error 13 Type Mismatch

11. run time error 13, data type mismatch !

 

 
Powered by phpBB® Forum Software