Member Login

Username
Password
Forget Password
New Sign Up
Search Forum

Buy Support
Incidents

If you can't find your answer in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us private or confidential information:

Click Here
If you can't login and post questions or you are having trouble viewing forum posts:
Click Here
Callback
Support

If you live in USA, UK, Canada, Australia or New Zealand, you can leave us details on your question and request us to call you back and discuss them with you personally  (charges apply).

Click Here
 
Buy Support
Incidents
If you can't find your answer in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us private or confidential information:
Click Here

Forum : Error parsing complete XML file on ItemNonInventory INSERTSearch Forum

Forum Home > QODBC - ODBC Driver for QuickBooks > QODBC v7 Forum

 New Topic 
 
 Post Reply 
[1]  
 Error parsing complete XML file on ItemNonInventory INSERT 
 Author   Message 
  Cindy Merkin 
  
 Group: Members 
 Posts: 9 
 Joined: 2006-11-02 
 Profile
 Posted : 2007-02-12 04:21:28

I'm attempting to add an item to the ItemNonInventory table using QB Pro 2007 and v7.00.00.207 of the QODBC driver.  For compatability with another program I'm using in my solution, I've trimmed the number of significant characters in a QB field name to 31.

Here's my SQL statement:

INSERT INTO ItemNonInventory ("Name", "SalesAndPurchaseSalesDesc", "SalesAndPurchaseSalesPrice", "SalesAndPurchaseIncomeAcctRefL") VALUES ('048243163557', '12/3G 250 GRND SOLID N-M WIRE', 00.00, '80000008-1167849636')

The SDK log contains:

20070209.151917 I 3192 QBSDKProcessRequest Application named 'FLEXquarters QODBC' starting requests (process 2612).
20070209.151918 E 3192 XercesSAXErrorHandler Not enough elements to match content model : '(SalesDesc?,SalesPrice?,IncomeAccountRef,PurchaseDesc?,PurchaseCost?,PurchaseTaxCodeRef?,ExpenseAccountRef,PrefVendorRef?)' -- error at line 7, column 220 in XML data.
20070209.151918 I 3192 MsgSetHandler Parser error, finishing.
20070209.151918 I 3192 QBSDKProcessRequest Application named 'FLEXquarters QODBC' finishing requests (process 2612), ret = 1.
20070209.151918 E 2612 RequestProcessor Process Request error = 80042500, There was an error when parsing the provided XML file.

The QODBC log contains:

IsAService: False
SQL Statement: INSERT INTO ItemNonInventory ("Name", "SalesAndPurchaseSalesDesc", "SalesAndPurchaseSalesPrice", "SalesAndPurchaseIncomeAcctRefL") VALUES ('048243163557', '12/3G 250 GRND SOLID N-M WIRE', 00.00, '80000008-1167849636')
Error parsing complete XML return string (8)
Input XML:
<?xml version="1.0" encoding="ISO-8859-1"?>
<?qbxml version="6.0"?>
<QBXML>
    <QBXMLMsgsRq onError = "continueOnError" responseData = "includeAll">
        <ItemNonInventoryAddRq requestID = "1">
            <ItemNonInventoryAdd>
                <Name>048243163557</Name>
                <SalesAndPurchase>
                    <SalesDesc>12/3G 250 GRND SOLID N-M WIRE</SalesDesc>
                    <SalesPrice>0.00000</SalesPrice>
                    <IncomeAccountRef>
                        <ListID>80000008-1167849636</ListID>
                    </IncomeAccountRef>
                </SalesAndPurchase>
            </ItemNonInventoryAdd>
        </ItemNonInventoryAddRq>
    </QBXMLMsgsRq>
</QBXML>
    ISAM_ERR_IN_COMP_SQL S0000 00000 [QODBC] Error parsing complete XML return string.
ISAMGetErrorMessage
    0x0018E628 [ISAM]
    S0000 00000 [QODBC] Error parsing complete XML return string.
ISAMClearUpdateRecord
    0x0018E628 [ISAM]
    0x0867FC98 [ItemNonInventory]
    NO_ISAM_ERR 00000 00000

Please help.

 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2007-02-12 08:41:21

The SQL statement you're using is incorrect, it should be:

INSERT INTO ItemNonInventory
("Name", "IsActive", "SalesTaxCodeRefListID", "SalesAndPurchaseSalesDesc",
"SalesAndPurchaseSalesPrice","SalesAndPurchaseIncomeAccountRefListID", "SalesAndPurchasePurchaseDesc",
"SalesAndPurchasePurchaseCost", "SalesAndPurchaseExpenseAccountRefListID", "SalesAndPurchasePrefVendorRefListID")
VALUES
('Support Ticket', TRUE, '10000-999022286', 'Callback VoIP Charge',
33.00, '1D0000-933270542', 'CallBack VoIP', 
33.00, '4D0000-933270542', '140000-933272657')

See: How do I insert data into ItemNonInventory? for more.

 

  Top 
  Cindy Merkin 
  
 Group: Members 
 Posts: 9 
 Joined: 2006-11-02 
 Profile
 Posted : 2007-02-13 00:34:10

OK, but the data required seems excessive.  I've had to start using the "SalesAndPurchase..." elements since my customer is using a different method to input his data using QB Pro 2007.  He was previously using QB Pro 2002 and with that imported QBW file, the SQL statement to perform the same function was:

INSERT INTO ItemNonInventory
("Name", "SalesOrPurchaseDesc", "SalesOrPurchasePrice","SalesOrPurchaseAccountRefListID")
VALUES
('Support Ticket', '10000-999022286', 33.00, '1D0000-933270542')

Why does going to the "SalesAndPurchase..." model from "SalesOrPurchase..." require so much overhead?

 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2007-02-13 08:47:55

To create a standard Non Inventory Part you can also use a more simplified INSERT statement like this:

INSERT INTO ItemNonInventory
("Name", "IsActive", "SalesORPurchaseDesc",
"SalesTaxCodeRefListID", "SalesOrPurchasePrice", "SalesOrPurchaseAccountRefListID")
VALUES
('QODBC NonInventory Test', TRUE, 'Test Insert of Non Inventory Part',
'20000-999022286', 100.00, '190000-933270541')

QODBC doesn't do any data validation, this is done by QuickBooks. For the samples I provided I've used all the columns necessary to ensure we are not putting garbage in and we are setting up proper accounting procedures.

 

  Top 
 New Topic 
 
 Post Reply 
[1]  

Jump to