Solved

Delete Query

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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
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.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

920 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

15 Experts available now in Live!

Get 1:1 Help Now