Database Editor Error

M

marcodesigns

When using the Database editor to update a record in one table, that has a one to many relationship with several other tables, I get the following error:

<<Database Results Error Description: [Microsoft][ODBC Microsoft Access Driver] The record cannot be deleted or changed because table 'GIexam' includes related records
Number: -2147467259 (0x80004005) Source: Microsoft OLE DB Provider for ODBC Drivers
One or more form fields were empty. You should provide default values for all form fields that are used in the query. an error that the record can not be updated because of those other tables. >

I tried creating an update asp page, but I get the same basic error. I can edit the record from with ACCESS with no problem, even using a simple form for the update. Any suggestions for a workaround / fix would be very much appreciated. This project is for a hospital and will run on a private Intranet.
 
J

Jim Buyens

This message usually occurs when you have a something like:

o An Order Header table that contains an order number.
o An Order Item table that contains the order
number and a line number.
o A referential integrity rule requiring that that every
Order Item record have a matching Order Header record,
based on Order Number.

In such a case, trying to change the order number in an
Order Header record would leave records in the Order Item
stranded (no matching Order header record).

The preferred solution is to assign an AutoNumber (or some
other value no one cares about) to the Order Header
record, and then match the Order Items based on that value
rather than the Order Number.

Otherwise, you may have to write custom code that creates
a new Order Header record, changes the order number on all
the Order Item records, and then deletes the original
Order header record.

I believe some database systems can also do it if you give
them both SQL statements at once. However, Access doesn't
have this capability.

Jim Buyens
Microsoft FrontPage MVP
http://www.interlacken.com
Author of:
*----------------------------------------------------
|\---------------------------------------------------
|| Microsoft Office FrontPage 2003 Inside Out
||---------------------------------------------------
|| Web Database Development Step by Step .NET Edition
|| Microsoft FrontPage Version 2002 Inside Out
|| Faster Smarter Beginning Programming
|| (All from Microsoft Press)
|/---------------------------------------------------
*----------------------------------------------------

-----Original Message-----
When using the Database editor to update a record in one
table, that has a one to many relationship with several
other tables, I get the following error:
<<Database Results Error Description: [Microsoft][ODBC
Microsoft Access Driver] The record cannot be deleted or
changed because table 'GIexam' includes related records.
Number: -2147467259 (0x80004005) Source: Microsoft OLE DB Provider for ODBC Drivers
One or more form fields were empty. You should provide
default values for all form fields that are used in the
query. an error that the record can not be updated because
of those other tables. >>
I tried creating an update asp page, but I get the same
basic error. I can edit the record from with ACCESS with
no problem, even using a simple form for the update. Any
suggestions for a workaround / fix would be very much
appreciated. This project is for a hospital and will run
on a private Intranet.
 
M

marcodesigns

Thanks for your help Jim! I found a work around by removing all instances of the primary key field from the DRW. The update worked perfectly after that. Separate headers would certainly work as well.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top