
OpenRecordset ("Table") or SQL statement
The Find methods (FindFirst, FindNext, FindPrevious, and FindLast) only work
with dynaset-type and snapshot-type recordsets, not with table-type
recordsets. Since the DBEngine found a table called 'mytable', it defaults
to a table-type. You can force a different type with the code:
Dbs.OpenRecordset ("mytable", dbOpenDynaset)
or
Dbs.OpenRecordset ("mytable", dbOpenSnapshot)
If you still open it using
Dbs.OpenRecordset ("mytable", [dbOpenTable])
you could use the Seek method, which is faster than the Find methods because
Seek uses indexes of the table.
Jeff Smith
JCom Computer Training
Quote:
>Hi!
>Can somebody tell me why FindFirst works when I use SQL statement like
> Dbs.OpenRecordset ("SELECT * FROM mytable")
>and doesn't work if I write
> Dbs.OpenRecordset ("mytable")?
>What is the difference? I would appreciate the clarification.
>Thanks!
>--
>Gene