Solved

Delete Query

Posted on 2008-10-27
5
157 Views
Last Modified: 2011-10-19
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
0
Comment
Question by:Richard Korts
5 Comments
 
LVL 75
ID: 22817405
By definition, the AutoNumber is unique.

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

mx
0
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 22817407
DELETE * FROM Orders where OrderNo = 16788
0
 
LVL 22

Expert Comment

by:Kelvin Sparks
ID: 22817417
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
0
 

Author Closing Comment

by:Richard Korts
ID: 31510551
Why is * needed in this case? It is not normally.
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 22817555
it is needed, because you connect via a "Microsoft OLE DB Provider for ODBC Drivers"
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

PL/SQL can be a very powerful tool for working directly with database tables. Being able to loop will allow you to perform more complex operations, but can be a little tricky to write correctly. This article will provide examples of basic loops alon…
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question