FP2000: Error Message When You Query the Database (265320)
The information in this article applies to:
This article was previously published under Q265320 SYMPTOMS
If you use the Database Results Wizard to create a page that uses a search form to query a database, you may receive an error message similar to the following in the Database Results region when you preview the page in a Web browser:
Database Results Error
Description: [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression '(EmployeeID = AND FirstName = '')'.
Number: -2147217900 (0x80040E14)
Source: Microsoft OLE DB Provider for ODBC Drivers
One or more form fields were empty. You should provide default values for all form fields that are used in the query.
CAUSE
The behavior occurs because empty number fields appear to mismatch the expected data type. Empty fields are not recognized as numbers.
RESOLUTION
To resolve this behavior, provide a default value for any database fields with a numeric data type. To do this, you must first determine which fields have Number or AutoNumber data types, and then edit the database results properties criteria to specify default values. To do this, follow these steps.
Step 1: Check Database Fields for Number or AutoNumber Data Types- In the Microsoft FrontPage Folders view, double-click the fpdb folder to open it, and then double-click the Microsoft Access database file that you are using with your query.
- In Microsoft Access, select the table or query that is the source of data for the search form, and then click Design.
- Make a note of the field names of any fields that have that have a data type of Number or AutoNumber.
- Close the table and quit Access.
Step 2: Edit the Database Results Properties Criteria- On the Web page, right-click the Database Results region, and then click Database Results Properties.
This starts the Database Results Wizard. - Click Next twice, until you are at step 3 of 5 in the wizard.
- Click More Options, and then click Defaults.
- Click to select a field that has the Number or AutoNumber data type in the database, and then click Edit.
- In the Value text box, type a default numeric value, such as 0, and then click OK.
- Repeat the two previous steps of this procedure (steps 4 and 5) for each field that has a Number or AutoNumber data type.
- Click OK twice to return to step 3 of 5 in the Wizard.
- Click Next twice, and then click Finish to complete the wizard.
- On the File menu, click Save.
- On the File menu, click Preview in Browser.
The Web page now appears without errors.
Modification Type: | Major | Last Reviewed: | 8/27/2002 |
---|
Keywords: | kbprb KB265320 |
---|
|