[AccessD] A2K: OpenRecordset doesn't

Andy Lacey andy at minstersystems.co.uk
Sat Apr 12 09:43:46 CDT 2003


Hiya Darren. Burning the night-time oil again?

Nothing wrong with that line that I can see. Give us a bit more can you?
Is dbs set right? Is rst dim'd right? As it's A2K it's not that rst
needs dimming as DAO.Recordset rather than just recordset is it?

Andy Lacey
http://www.minstersystems.co.uk



> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com 
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darren DICK
> Sent: 12 April 2003 15:33
> To: AccessD List
> Subject: [AccessD] A2K: OpenRecordset doesn't
> 
> 
> Hello all
> Can anyone shed some light on why my code fails on
> the line...
>  Set rst = dbs.OpenRecordset("SELECT * FROM
> tblMyTable;", dbOpenDynaset)
> and I get the error "Run time error 13 'Type
> Mismatch"
> 
> Many thanks
> Darren
> 
> ________________________________
> Public Sub MySub()
> Dim dbs As Database
> Dim rst As Recordset
> 
>     Set dbs = CurrentDb
>     '<Fails on the line below>
>     Set rst = dbs.OpenRecordset("SELECT * FROM
> tblMyTable;", dbOpenDynaset)
>     '<Fails on the line above>
> 
>     With rst
>         .MoveLast
>         Debug.Print .RecordCount
>         .Close
>     End With
> 
>     Set dbs = Nothing
> 
> End Sub
> 
> 
> ________________________________
> 
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com 
> http://databaseadvisors.com/mailman/listinfo/a> ccessd
> Website: 
> http://www.databaseadvisors.com
> 
> 



More information about the AccessD mailing list