Solved

Delete Query

Posted on 2008-10-27
5
153 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 142

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 142

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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 …

760 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now