The information in this article applies to:
SYMPTOMSWhen you create a Dynaset or Snapshot using the SQL PASSTHROUGH option with an ODBC database, the FindFirst, FindNext, FindLast, and FindPrevious methods give the error "Can't perform operation; it is illegal." CAUSEFindFirst, FindNext, FindLast, and FindPrevious work only on record sets opened by a query. Visual Basic version 3.0 doesn't use a query to open a record set when you use DB_SQLPASSTHROUGH, so these Find methods are not allowed, by design. RESOLUTIONThe SQL PASSTHROUGH option causes the query to be processed by an external database server, instead of by Visual Basic. Avoid using the SQL PASSTHROUGH option if you want to use the FindFirst, FindNext, FindLast, or FindPrevious methods with an ODBC database. Also, you can avoid the problem by creating a copy of the dynaset or snapshot. This will allow the Microsoft Access Engine to perform the FindFirst rather than allowing the ODBC server to do it. However, the the dynaset copy must not use the SQL PASSTHROUGH option. Here is an example:
STATUSThis behavior is by design. REFERENCEPages 58-60, Visual Basic Professional Edition, Version 3.0, "Professional Features Book 2."MORE INFORMATIONSteps to Reproduce BehaviorThe following code results in the "Can't perform operation; it is illegal" error:
Additional query words: 3.00
Keywords : |
Last Reviewed: September 17, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |