Knowledgebase: Tutorials
[QODBC] Not supported - At least one Line record is required. Please insert Child/Detail record(s) before inserting Parent/Header record.
Posted by Rajendra Dewani (QODBC Support) on 22 October 2025 03:17 AM

Problem Description:

I am getting the following error trying to insert a record in Invoice:

[QODBC] Not supported - At least one Line record is required. Please insert Child/Detail record(s) before inserting Parent/Header record. (#10074)


Step1

 

 

Solution:

How to Fix the Error
To resolve this issue, you must change the order of your data insertion or SQL statements to ensure the required detail exists before the header.

Insert the Detail Records First: Before you attempt to insert data into the Parent/Header table (e.g., Invoice), you must successfully insert at least one corresponding record into the Child/Detail/Line table (e.g., InvoiceLine).


INSERT INTO InvoiceLine (InvoiceLineItemRefListID, InvoiceLineDesc, InvoiceLineRate, InvoiceLineAmount, InvoiceLineSalesTaxCodeRefListID, FQSaveToCache) VALUES ( '320000-1071525597', 'POWERTRAK-2000', 200.00000, 200.00, '20000-999022286',1)

INSERT INTO InvoiceLine (InvoiceLineDesc, FQSaveToCache) VALUES ('POWERTRAK-3000', 1)

INSERT INTO InvoiceLine (InvoiceLineDesc, FQSaveToCache) VALUES ('POWERTRAK-4000', 0)

 

Insert the header record: 

INSERT INTO Invoice (CustomerRefListID, RefNumber, FQSaveToCache) VALUES ('670000-1071517519', '71099',0)

Insert the Header Record Last: Once the detail record(s) are in place, you can then insert the Parent/Header record, completing the transaction.





MS Access:

If you are using MS Access application, the connection string or the connection object is getting closed after you insert the Invoice Line and before you can insert the Invoice (Header) record.
This could be because your linked tables have different connection strings. You can delete the linked table and re-add the linked tables.

If you are using ADO/DOA objects, please ensure you do not close the connection between the insert of InvoiceLine and the Invoice table.

(0 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please complete the captcha below (we use this to prevent automated submissions).