BillKollatos
asked on
record is deleted - more wierd than ever
Hi All.
I am getting a "record is deleted" error when trying to append records into a linked table from another MSACCESS DATABE.
- The two databases are linked on a network
- I have compacted and repaired both databases
- The APPEND QUERY tables are linked to another server over the network to an SQL Database via ODBC
- The is no #Deleted# message in either the append query nor the appending database
- If I make the table local (by copying and pasting", and try to append locally I get the sqame error
- The append was preceded by a delete all query
- I can run the query as a make table query locally
- IF I OPEN THE QUERY AND COPY ALL RECORDS AND THEN OPEN THE LINKED TABLE AND PASTE THEM, IT WORKS (unfortunaetly, I need to run this asutomatically)
- IF I REMOVE THE LEFT JOIN ON ACCOUNTS_2, IT WORKS!!
- The error occurs by trying to update the "ACCOUNTS_2.AccountName AS DeliveryFranchisee" field which does contain empty values. (IT IS APPENDING TO A TEXT FIELD)
below is the append query:
========================== ========== ========== ========== ========== ========
INSERT INTO tblPackingBarcodes ( FranchiseePackingAllocatio n, CustomerGroupAllocation, FranchiseePackingOrder, FranchiseeID, FranchiseeDeliveryID, CustomerID, CustomerOrder, BarcodeSalesDTLID, DeliveryDate, Franchisee, DeliveryFranchisee, Customer, Barcode, PackingSectionSplit, ItemNumber, ItemName, ItemUOM, PackingComment, PickQty, Quantity, MultipleBarcodes )
SELECT ACCOUNTS_1.FranchiseePacki ngAllocati on, 0 AS CustomerGroupAllocation, 0 AS FranchiseePackingOrder, SALESHEADER.ParentAccountI D AS FranchiseeID, ACCOUNTS.DeliveryAccountID , SALESHEADER.AccountID AS CustomerID, 0 AS CustomerOrder, SALESDETAIL.SalesDTLID AS BarcodeSalesDTLID, SALESHEADER.DeliveryDate, ACCOUNTS_1.AccountName AS Franchisee, ACCOUNTS_2.AccountName AS DeliveryFranchisee, ACCOUNTS.AccountName AS Customer, StrConv([SalesDTLID],1) AS Barcode, ITEMPACKINGLOCATIONS.Packi ngSectionS plit, ITEMS.ItemNumber, ITEMS.ItemName, ITEMUOMS.ItemUOM, SALESDETAIL.PackingComment , 0 AS PickQty, SALESDETAIL.Quantity, ITEMUOMS.MultipleBarcodes
FROM (ITEMPACKINGLOCATIONS INNER JOIN (((ACCOUNTS INNER JOIN ACCOUNTS AS ACCOUNTS_1 ON ACCOUNTS.ParentAccountID = ACCOUNTS_1.AccountID) INNER JOIN SALESHEADER ON ACCOUNTS.AccountID = SALESHEADER.AccountID) INNER JOIN ((ITEMS INNER JOIN ITEMUOMS ON ITEMS.ItemSellUOMID = ITEMUOMS.ItemUOMID) INNER JOIN SALESDETAIL ON ITEMS.ItemID = SALESDETAIL.ItemID) ON SALESHEADER.SalesHDRID = SALESDETAIL.SalesHDRID) ON ITEMPACKINGLOCATIONS.Packi ngID = ITEMS.PackingID) LEFT JOIN ACCOUNTS AS ACCOUNTS_2 ON ACCOUNTS.DeliveryAccountID = ACCOUNTS_2.AccountID
WHERE (((SALESHEADER.DeliveryDat e)=Date()) AND ((SALESDETAIL.Quantity)>0) AND ((ACCOUNTS.AccountLevel)=3 ) AND ((SALESHEADER.InvoiceStatu sID)="OR") );
========================== ========== ========== ========== ========== ===
THANKING YOU IN ADVANCE!
I am getting a "record is deleted" error when trying to append records into a linked table from another MSACCESS DATABE.
- The two databases are linked on a network
- I have compacted and repaired both databases
- The APPEND QUERY tables are linked to another server over the network to an SQL Database via ODBC
- The is no #Deleted# message in either the append query nor the appending database
- If I make the table local (by copying and pasting", and try to append locally I get the sqame error
- The append was preceded by a delete all query
- I can run the query as a make table query locally
- IF I OPEN THE QUERY AND COPY ALL RECORDS AND THEN OPEN THE LINKED TABLE AND PASTE THEM, IT WORKS (unfortunaetly, I need to run this asutomatically)
- IF I REMOVE THE LEFT JOIN ON ACCOUNTS_2, IT WORKS!!
- The error occurs by trying to update the "ACCOUNTS_2.AccountName AS DeliveryFranchisee" field which does contain empty values. (IT IS APPENDING TO A TEXT FIELD)
below is the append query:
==========================
INSERT INTO tblPackingBarcodes ( FranchiseePackingAllocatio
SELECT ACCOUNTS_1.FranchiseePacki
FROM (ITEMPACKINGLOCATIONS INNER JOIN (((ACCOUNTS INNER JOIN ACCOUNTS AS ACCOUNTS_1 ON ACCOUNTS.ParentAccountID = ACCOUNTS_1.AccountID) INNER JOIN SALESHEADER ON ACCOUNTS.AccountID = SALESHEADER.AccountID) INNER JOIN ((ITEMS INNER JOIN ITEMUOMS ON ITEMS.ItemSellUOMID = ITEMUOMS.ItemUOMID) INNER JOIN SALESDETAIL ON ITEMS.ItemID = SALESDETAIL.ItemID) ON SALESHEADER.SalesHDRID = SALESDETAIL.SalesHDRID) ON ITEMPACKINGLOCATIONS.Packi
WHERE (((SALESHEADER.DeliveryDat
==========================
THANKING YOU IN ADVANCE!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
sorry pcelba, one more thing. How exactly do you suggets to run this secondary select query? within the existing append query? not sure how you do this in an access query?
The update is good solution in your situation.
The second query was oferred as a replacement for tblPackingBarcodes table without DeliveryFranchisee column. It means the append query can insert everything except DeliveryFranchisee which will be added in the second query without update necessity.
Everything above is a work around and Access 2003 Jet engine is probably unable to handle it as you need in one simple append query.
You could try ACE engine in Access 2007 which is much better.
The second query was oferred as a replacement for tblPackingBarcodes table without DeliveryFranchisee column. It means the append query can insert everything except DeliveryFranchisee which will be added in the second query without update necessity.
Everything above is a work around and Access 2003 Jet engine is probably unable to handle it as you need in one simple append query.
You could try ACE engine in Access 2007 which is much better.
INSERT INTO tblPackingBarcodes (
FranchiseePackingAllocatio
FranchiseeID, FranchiseeDeliveryID, CustomerID,
CustomerOrder, BarcodeSalesDTLID,
DeliveryDate, Franchisee,
Customer, Barcode, PackingSectionSplit,
ItemNumber, ItemName, ItemUOM, PackingComment,
PickQty, Quantity, MultipleBarcodes, DeliveryAccountID )
SELECT ACCOUNTS_1.FranchiseePacki
SALESHEADER.ParentAccountI
0 AS CustomerOrder, SALESDETAIL.SalesDTLID AS BarcodeSalesDTLID,
SALESHEADER.DeliveryDate, ACCOUNTS_1.AccountName AS Franchisee,
ACCOUNTS.AccountName AS Customer, StrConv([SalesDTLID],1) AS Barcode, ITEMPACKINGLOCATIONS.Packi
ITEMS.ItemNumber, ITEMS.ItemName, ITEMUOMS.ItemUOM, SALESDETAIL.PackingComment
0 AS PickQty, SALESDETAIL.Quantity, ITEMUOMS.MultipleBarcodes,
FROM (ITEMPACKINGLOCATIONS INNER JOIN (((ACCOUNTS INNER JOIN ACCOUNTS AS ACCOUNTS_1 ON ACCOUNTS.ParentAccountID = ACCOUNTS_1.AccountID) INNER JOIN SALESHEADER ON ACCOUNTS.AccountID = SALESHEADER.AccountID) INNER JOIN ((ITEMS INNER JOIN ITEMUOMS ON ITEMS.ItemSellUOMID = ITEMUOMS.ItemUOMID) INNER JOIN SALESDETAIL ON ITEMS.ItemID = SALESDETAIL.ItemID) ON SALESHEADER.SalesHDRID = SALESDETAIL.SalesHDRID) ON ITEMPACKINGLOCATIONS.Packi
WHERE (((SALESHEADER.DeliveryDat
Open in new window