FP97: Syntax Error If Query Contains Parameter Values

Last reviewed: March 18, 1998
Article ID: Q159435
The information in this article applies to:
  • Microsoft FrontPage 97 for Windows with Bonus Pack

SYMPTOMS

When you use a query containing parameter values generated by the Internet Database Connector Wizard, the ODBC driver may return a syntax error in the query expression.

CAUSE

There are many possible causes for syntax errors in ODBC queries. If the parameter value you specified contains text, check to make sure the parameter is enclosed in single quotation marks. The FrontPage Database Connector Wizard doesn't insert single quotation marks around parameter values.

RESOLUTION

When you specify a parameter in an SQL statement that will contain text, enclose the parameter in single quotation marks.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article.

MORE INFORMATION

When FrontPage creates the IDC file, it cannot determine the type of value that will be used for a parameter. If the value in the parameter is numeric, the query will run without error. However, if the value in the parameter is text, the query will fail unless you enclose the parameter in single quotation marks.

If you insert the Input parameter in an SQL statement using the IDC Wizard, the resulting SQL statement may resemble the following:

   Select * from Orders where Order = %Input%

This statement will select all records from the Orders table where the Order field is equal to the Input parameter. If the Order field in the Orders table is a numeric field, the query will function without error. If the Order field in the Orders table is a text field, the query will need to be adjusted as follows:

   Select * from Orders where Order = '%Input%'

Microsoft FrontPage does not record or correct SQL statements. For support on SQL syntax, please consult your Database Management System's documentation.

For more information on Internet Database Connector technology, see Chapter 8, "Publishing Information and Applications," of the online documentation for Microsoft Internet Information Server. Note that Chapter 8 of this documentation is available at the following Web site:

   http://www.microsoft.com/infoserv/docs/program.htm

NOTE: Because the Microsoft Web site is constantly updated, the site address may change without notice. If this occurs, link to the Microsoft home page at the following address:

   http://www.microsoft.com


Additional query words: 97
Keywords : fpodbc kbnetwork kbdta
Version : windows:97
Platform : WINDOWS
Hardware : x86
Issue type : kbprb


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: March 18, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.