DataBase - Delete query - delete from specified tables error

Asked By klkropf
03-Feb-10 01:27 PM
I am running a delete query and am getting the error "could not delete from
specified table".  I have looked at the other entries on this, but still
cannot figure out what I am doing wrong.  Below is the SQL.


DELETE tblDemotionFY10.*, tblQuarters.Quarter
FROM tblQuarters INNER JOIN tblDemotionFY10 ON tblQuarters.MonthNumber =
tblDemotionFY10.MonthNumber
WHERE (((tblQuarters.Quarter)=[Enter Quarter]));

Thanks!
TblDemotionFY10.MonthNumber
(1)
TblQuarters.MonthNumber
(1)
TblDemotionFY10
(1)
Database
(1)
TblQuarters.Quarter
(1)
TblQuarters
(1)
Bontrager
(1)
Window
(1)
  Jerry Whittle replied to klkropf
03-Feb-10 01:56 PM
You are trying to delete from two tables at once. That's very hard to do with
Access. If you have the tables joined in the Relationship window with
Referential Integrity enabled, you could enable Cascade Delete. Then if you
deleted a record from the parent table, matching records in the child table
would also be deleted.

Otherwise it is a two step process where you delete records from the child
table first, then delete records from the parent table.

This assumes that you really want to delete records from both tables. That's
how the SQL reads. If you only want to delete records from one table, tell us
which table and we could help.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.
  klkropf replied to Jerry Whittle
03-Feb-10 05:09 PM
I only want to delete records from one table, tblDemotionFY10.
  Jerry Whittle replied to klkropf
03-Feb-10 05:44 PM
Try this on a backup copy of the database / tables!:

DELETE tblDemotionFY10.*
FROM tblDemotionFY10
WHERE tblDemotionFY10.MonthNumber
In (SELECT tblQuarters.MonthNumber
FROM tblQuarters
WHERE tblQuarters.Quarter=[Enter Quarter]);
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.
  klkropf replied to Jerry Whittle
03-Feb-10 05:56 PM
Perfect!  Thank you so much.
Create New Account
help
Library Database DataBase Firstly, I am not sure if Library database is the correct term. I am talking about Dbs to which you set a reference drew blanks last time. Now assuming I have several referenced (library?) databases in my main database, how do I get the names of all the forms in all the Dbs? CodeProject AllForms.Count gives me the correct number of forms if I am in that referenced database. What I think I need is a method of looping through all the different CodeProject names in the main database, but there is not a sort of CodeProjects parent object. Or somehow moving the focus And, No, there is not any parent object for all the code projects. Because each database only knows about its own objects (or documents), you have to use a procedure in each database to refer to the objects in that database. E.g. to open a form in
Might be outgrowing Access but daunted by SQL Server DataBase I am close to completing the consolidation of various small Access databases and a couple of Excel spreadsheets that my little company uses (5 staff) into an all encompasing Access database and I was planning on splitting the database when I was finished to allow simaltaneous use of it by staff on our small to me that I am going to need to give staff access to this new database from remote locations (outside of our office network). Two staff members are regularly overseas, one been playing around with trying to link tables from remote locations (ftp path of the database on our Network Storage Device at the office) and needless to say - that do not It all started when I came across a very encouraging article on keeping your Access database as your front end application and linking to SQL Server database tables. I am finding it MUCH more complicated than I had hoped. Can anyone suggest a simpler way of achieving remote access to my database? I have at my disposal a Network Storage Device which has remote access capabilities (this
SQL query slow DataBase Hi In the code below I found that it takes 1.3 seconds to load suited to handle databases beyond stamp collection size and lacks most features of a "real" database management system. Consider using a relational database, i.e. SQL Server Express, its free. Make sure to set primary key properties to to worry about problems like SQL injection attacks to you application. best, MiB. The JET database engine is often faster and more efficient than similar retrieval with SQL Server. And simply can be summed up as your general ignorance on the matter how = 20 computers and database engines function and operate in our industry. So your galactic stupidity and ignorance is well years - version 4 came with Office 2000. If JET is so vastly superior to regular database servers, kindly share the pearls of your wisdom and explain why companies like Oracle (guess rationale, but I am sure you will enlighten us. Can you also explain, please, why database client products like Sparxsystems Enterprise Architect using the same relational schema, same index structures, and to criticize an important MVP like you. Maybe this source is: http: / / databases.aspfaq.com / database / what-are-the-limitations-of-ms-acc = ess.html. I would like to humbly hint
Restated: "Fields are expensive, records are cheap" DataBase Hi, First let me apolozie for the empty question below. I hit the Post button multiple small rows versus one large row. And we are assuming a 3rd normal form database design. And it may well be that I am totally misinterpreting the ???Fields are expensive your comments. Dennis Access Tables DB Design Discussions Access 2007 (1) Oracle (1) VBA (1) Database (1) Report (1) MVFs (1) Sharepoint (1) Attributes (1) The mantra in the subject line is purely a rule-of-thumb for beginning database designers. It has no bearing on your question about data access. Your question revolves around use up 510 bytes (unicode) of disk space to store those 2 characters. Internally, the database keeps track of where each field starts in each record. Some fields (memo, OLE, attachments being faster to retrieve. There are many other factors at work here, including whether the database has been compacted recently, whether you are using page- or record-locking, whether the disk just for performance reasons. The management of those relationships alone represents unnecessary complexity for the database and for developer. You may be forced to go that route if you are subclassing thinking in posting.) Having said that, having 60 fields in one table is unusual. The database I happen to be working on right now has 93 tables, and none of them
Reference another database DataBase I have no idea if this is possibe. Suppose I have 2 separate front end is supplied from the BE databases. What I want to do is have yet another database called say Menus.accdb which contains the 2 aforementioned forms, and remove those forms from I redesign either of those forms, I only need to do it once, and any database referencing the Menu.accdb will "see" the new design. So 1 Can it be done However, this is not my experience. I use many forms from a Menus.mdb- like database as generic forms in all my applications. If one needs another generic form, well, make the time element) is that I need to use the linked tables in the BE database for the menu system. How and when do you link the menu database to those table? How & where do you set the reference to the menu.accdb? is forms Thanks for your help Phil Phil If you are really going to automate your database, you write code to link the tables when you start it up. Microsoft has stopped