Link to home
Start Free TrialLog in
Avatar of Richard Korts
Richard KortsFlag for United States of America

asked on

Delete Query

What is wrong with this delete query?

DELETE Orders where OrderNo = 16788

OrderNo is AutoNumber. Table structure in attached jpg.

I get this error:

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
Orders-table.jpg
Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Flag of United States of America image

By definition, the AutoNumber is unique.

So, remove those other three fields as part of the Primary Key.

mx
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Try DELETE * FROM Orders WHERE OrderNo = 16788

A point of note adding the next three fields to the primary key has not helped as you cannot have two OrderNos with the same number. It doesn't add anything. The OrderNo alone who do the same. You may want to add the other fields as n Index of some sort.


Kelvin
Avatar of Richard Korts

ASKER

Why is * needed in this case? It is not normally.
it is needed, because you connect via a "Microsoft OLE DB Provider for ODBC Drivers"