Microsoft KB Archive/265320

= FP2000: Error Message When You Query the Database =

Article ID: 265320

Article Last Modified on 8/27/2002

-

APPLIES TO


 * Microsoft FrontPage 2000 Standard Edition

-



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

 * 1) 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.
 * 2) In Microsoft Access, select the table or query that is the source of data for the search form, and then click Design.
 * 3) Make a note of the field names of any fields that have that have a data type of Number or AutoNumber.
 * 4) Close the table and quit Access.

Step 2: Edit the Database Results Properties Criteria

 * 1) On the Web page, right-click the Database Results region, and then click Database Results Properties.

This starts the Database Results Wizard.
 * 1) Click Next twice, until you are at step 3 of 5 in the wizard.
 * 2) Click More Options, and then click Defaults.
 * 3) Click to select a field that has the Number or AutoNumber data type in the database, and then click Edit.
 * 4) In the Value text box, type a default numeric value, such as 0, and then click OK.
 * 5) Repeat the two previous steps of this procedure (steps 4 and 5) for each field that has a Number or AutoNumber data type.
 * 6) Click OK twice to return to step 3 of 5 in the Wizard.
 * 7) Click Next twice, and then click Finish to complete the wizard.
 * 8) On the File menu, click Save.
 * 9) On the File menu, click Preview in Browser.

The Web page now appears without errors.



MORE INFORMATION
For additional information about working with FrontPage and Access Data Types, click the article numbers below to view the articles in the Microsoft Knowledge Base:

296653 FP2000: Error Querying Date/Time Fields in Access Database

Additional query words: front page

Keywords: kbprb KB265320

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.