Others

Fix a Missing Operator in a Microsoft Access SQL DELETE Statement

Huda QurayshiHuda Qurayshi Nov 22, 2026 868 views

Question details

Correct an Access SQL DELETE statement that produces a missing operator or syntax error in an OleDb application.

Fix a Missing Operator in a Microsoft Access SQL DELETE Statement
Product
Microsoft Access and OleDb
Device & OS
not provided
Scenario
An application needs to delete records from an Access table using multiple conditions.
Observed behavior
The DELETE query returns a syntax error when FROM is omitted or conditions are combined incorrectly.
Before you start

Check the table and field names in Access and identify the data type of each value used in the WHERE clause. Run an equivalent SELECT query with the same conditions to verify which records will be deleted.

Solution 1Recommended

Correct the Access DELETE syntax and use OleDb parameters

Use FROM and AND to form a valid DELETE statement, then pass values as parameters rather than concatenating them into SQL.

1
Correct the DELETE statement

In the application's OleDbCommand, use a statement such as: DELETE * FROM [people] WHERE [Id] = ? AND [Name] = ?. Replace the table and field names with those in your database, and join additional conditions with AND.

2
Add parameters in order

Add one OleDbParameter for each ? placeholder to the command's Parameters collection. Add the Id value first and the Name value second, using OleDb types that match the corresponding Access fields.

3
Verify the matching records

Before executing the DELETE command, run SELECT * FROM [people] WHERE [Id] = ? AND [Name] = ? with the same parameter values and confirm that the results are the intended records.

4
Execute the command

Open the OleDbConnection and call ExecuteNonQuery on the parameterized DELETE command. Check the returned row count to see how many records were deleted.

Correct the Access DELETE syntax and use OleDb parameters
OleDb parameter order matters: OleDb binds ? placeholders by position, so parameters must be added in the same order as their placeholders appear in the SQL statement.
Free Microsoft Office alternative

Work with exported Access data in WPS Office

WPS Office is a free, lightweight alternative with a familiar interface for working with exported tabular data and other Office files. It supports common Microsoft Office formats for easy migration, but it does not execute Access SQL or fix OleDb queries.

Review and analyze data exported from Access in WPS Spreadsheets.Open and edit Microsoft Excel XLSX files as well as Word DOCX and PowerPoint PPTX files.Use a familiar interface to transition from Microsoft Office.Work with a free, lightweight office suite.
microsoft office alternative - wps office

Frequently Asked Questions

What is the correct DELETE syntax in Access SQL?

Use DELETE * FROM [table_name] WHERE condition. For multiple conditions, join them with AND or OR as appropriate, for example: DELETE * FROM [people] WHERE [Id] = ? AND [Name] = ?.

Why does OleDb require parameters in a particular order?

OleDb matches ? placeholders by position. Add values to the OleDbCommand Parameters collection in the same order as the placeholders appear, regardless of parameter names.

How can I check which records will be deleted?

Run a SELECT query with the same FROM and WHERE clauses and the same parameter values. Review the results before running the DELETE command.

Can WPS Office run an Access DELETE query?

No. Run the query through Access or your OleDb application. WPS Spreadsheets can open supported spreadsheet files exported from Access for review.