Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Delete Query

Posted on 2008-10-27
5
Medium Priority
?
160 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 2000 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

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

730 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