FP97: Syntax Error If Query Contains Parameter ValuesLast reviewed: March 18, 1998Article ID: Q159435 |
The information in this article applies to:
SYMPTOMSWhen 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.
CAUSEThere 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.
RESOLUTIONWhen you specify a parameter in an SQL statement that will contain text, enclose the parameter in single quotation marks.
STATUSMicrosoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article.
MORE INFORMATIONWhen 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.htmNOTE: 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
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |