PRB: Run-time Error 3024 Using SQL and DAO Against OracleID: Q187297
|
If you try to run Structured Query Language (SQL) against an Oracle
database through Data Access Objects (DAO) you can encounter the following
error:
Run-Time Error 3024
Couldn't find file C:\Program Files\DevStudio\VB\<schema name>.mdb.
If you add the dbSQLPassThrough option to the OpenRecordset method, the
sample code in the MORE INFORMATION section of this article runs without
error. You can use brackets [ ] around the table name in the SQL string to
avoid the error as well:
sql = "SELECT * FROM scott.[emp]"
This behavior is by design.
The error message is generated because DAO tries to find an .mdb file in
the local directory that matches the schema name you specified for the
Oracle object in your SQL.
sql = "SELECT * FROM scott.emp"
Set wks = Workspaces(0)
Set con = wks.OpenDatabase("dseOracle", False, False, _
& "ODBC;UID=scott;PWD=tiger;")
Set rss = con.OpenRecordset(sql, dbOpenSnapshot)
For information on how to acquire ADO and the new Microsoft Oracle ODBC
driver, please see the following article in the Microsoft Knowledge Base:
Q175018 : HOWTO: Acquire and Install the Microsoft Oracle ODBC Driver
Q176936 : INFO: Visual Basic 5.0 Accessing an Oracle Database Using ADO
"Hitchhiker's Guide to Visual Basic & SQL Server," William Vaughn, 784 pages, Microsoft Press, 1997
Additional query words: kbOracle kbDAO350 kbVBp500
Keywords : kbcode kberrmsg kbDAO kbVBp500
Version : WINDOWS:5.0
Platform : WINDOWS
Issue type : kbprb
Last Reviewed: June 7, 1999