PRACC9309: Incorrect Error Message Using OpenTable Method

PSS ID Number: Q104066
Article last modified on 09-20-1993

1.00 1.10
WINDOWS

---------------------------------------------------------------------
The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1
 - Microsoft Access Distribution Kit version 1.1
---------------------------------------------------------------------

SYMPTOMS
========
When you use the OpenTable method in Access Basic on tables with
certain table names that do not exist, you get the following error
message
   Syntax error in <xxxxx> statement
instead of the expected error message
   Object does not exist
For example, if you try open a nonexistent table called "Delete This
Table," you would receive a "Syntax error in DELETE statement" error
message, rather than an "Object does not exist" error message.

CAUSE
=====
If the table referenced in the OpenTable method does not exist,
Microsoft Access tries to interpret the table name as a SQL statement.
Since the statement is not valid, you receive the SQL parsing error
"Syntax error in DELETE statement."
Because of this, other SQL statements used as valid but nonexistent
table names can cause other SQL parsing error messages. Some of the
other possible error messages are listed in the table below:

If Table Name Is...        Microsoft Access Error Message Is...
--------------------------------------------------------------------
Select                     Syntax error in Select statement
Select * from authors      Missing semicolon at end of SQL
                           statement (when Authors table does not exist)
Select * from authors;     Couldn't find input table or query
                           "Authors" (when Authors table does exist)
Select * from authors;     Couldn't find object "Select * from
                           authors;"

STATUS
======
Microsoft has confirmed this to be a problem in Microsoft Access
versions 1.0 and 1.1. Microsoft is researching this problem and will
post new information here in the Microsoft Knowledge Base as it
becomes available.

Additional reference words: 1.00 1.10 Tables Programming
KBCategory:
KBSubcategory: PrgrmVt
Copyright Microsoft Corporation 1993.