Displaying error from Build Assembly |
Author |
Message |
Gerd |
|
Group | : Members |
Posts | : 28 |
Joined | : 2008-12-09 |
|
Profile |
|
Posted : 2008-12-28 23:32:39 |
QB 2008 Prem, QODBC V9
When building an assembly using a VBA I would like to display an error message, if there are not enough components for the item. When executing the build assemblies SQL I find the messages in QODBC Messages that I would like to monitor.
2008-12-28 04:23:02 QODBC Ver: 9.00.00.253 ********************************************************************************************************************* IsAService: False SQL Statement: INSERT INTO BuildAssembly (ItemInventoryAssemblyRefFullName, RefNumber, QuantityToBuild, Memo) VALUES ('Rooibos:10025008', '2316', 10, 'QB Sales #: 2316') 3370 - QuickBooks does not have enough components on hand to build this assembly item. Input XML: <?xml version="1.0" encoding="ISO-8859-1"?> <?qbxml version="7.0"?> <QBXML> <QBXMLMsgsRq onError = "continueOnError" responseData = "includeAll"> <BuildAssemblyAddRq requestID = "1"> <BuildAssemblyAdd defMacro = "TxnID:1A787594-5D95-426C-B0D4-A97C9BB7725E"> <ItemInventoryAssemblyRef> <FullName>Rooibos:10025008</FullName> </ItemInventoryAssemblyRef> <RefNumber>2316</RefNumber> <Memo>QB Sales #: 2316</Memo> <QuantityToBuild>10.00000</QuantityToBuild> </BuildAssemblyAdd> </BuildAssemblyAddRq> </QBXMLMsgsRq> </QBXML> Output XML: <?xml version="1.0" ?> <QBXML> <QBXMLMsgsRs> <BuildAssemblyAddRs requestID="1" statusCode="3370" statusSeverity="Error" statusMessage="QuickBooks does not have enough components on hand to build this assembly item." /> </QBXMLMsgsRs> </QBXML>
I would like to get the
3370 - QuickBooks does not have enough components on hand to build this assembly item.
message and display it or maybe even display the entire message. |
|
|
|
Tom |
|
Group | : Administrator |
Posts | : 5510 |
Joined | : 2006-02-17 |
|
Profile |
|
Posted : 2008-12-29 09:04:13 |
You need to setup an error handler in your code, for example:
ERR_SEND: Select Case Err.Number Case 3370 MsgBox "Build Assembly '" + sRefNumber + "' failed." + vbCrLf + "QuickBooks does not have enough components on hand to build this assembly item." + vbCrLf + "Please write down the reference number and research it after this process is complete.", vbExclamation bDupError = True Resume Next Case Else MsgBox CStr(Err.Number) + "--" + Err.Description Exit Sub End Select |
|
|
|
Gerd |
|
Group | : Members |
Posts | : 28 |
Joined | : 2008-12-09 |
|
Profile |
|
Posted : 2008-12-29 09:08:07 |
that is exactly what I did. i just changed the message # to 3370 but I don't get that message. the message # i get instead looks like a system message or vb message rather then a QODBC message |
|
|
|
Tom |
|
Group | : Administrator |
Posts | : 5510 |
Joined | : 2006-02-17 |
|
Profile |
|
Posted : 2008-12-29 09:34:25 |
You need to add a:
On Error GoTo ERR_SEND
in your code before you define your variables. |
|
|
|
Gerd |
|
Group | : Members |
Posts | : 28 |
Joined | : 2008-12-09 |
|
Profile |
|
Posted : 2008-12-29 09:37:59 |
that's the first statement in my sub. when debugging the program i see the SQL string being built and executed, that when the error routine is called |
|
|
|
Gerd |
|
Group | : Members |
Posts | : 28 |
Joined | : 2008-12-09 |
|
Profile |
|
Posted : 2008-12-29 09:40:00 |
the exact error message i get is
Error: -2147217887 QODBC driver does not support the requested properties |
|
|
|
Gerd |
|
Group | : Members |
Posts | : 28 |
Joined | : 2008-12-09 |
|
Profile |
|
Posted : 2009-01-05 06:13:50 |
Tom, is there any other option that I can monitor for the correct error number? I added the error routine to some other VBA to check for those QB messages but whatever I do, I always get the -2147217887 error number. Nothing else.
I am also curious if there are other guys using VBA with QODBC. If there are, I really would appreciate if you could post a short reply.
Thanks |
|
|
|