BASIC Developer & Support Resources > VB (5/6/CE) Classic

Quickbooks SDK

<< < (2/3) > >>

I forgot about Dave's COM object interface viewer addition.

Interface: IQBSessionManager
ProgID: QBFC13.QBSessionManager.1
CLSID: {22E885D7-FB0B-49E3-B905-CCA6BD526B52}
Sub OpenConnection(AppID As String, AppName As String)
Sub BeginSession(qbFile As String, openMode As ENOpenMode)
Sub EndSession()
Sub CloseConnection()
Function GetCurrentCompanyFileName() As String
Function CreateMsgSetRequest(Country As String, qbXMLMajorVersion As Integer, qbXMLMinorVersion As Integer) As Object
Function ToMsgSetResponse(qbXMLResponse As String, Country As String, qbXMLMajorVersion As Integer, qbXMLMinorVersion As Integer) As Object
Function DoRequests(request As Object) As Object
Sub GetVersion(MajorVersion As Object, MinorVersion As Object, releaseLevel As Object, releaseNumber As Object)
Function DoRequestsFromXMLString(qbXMLRequest As String) As Object
Get QBXMLVersionsForSession() As Array
Function CreateSubscriptionMsgSetRequest(qbXMLMajorVersion As Integer, qbXMLMinorVersion As Integer) As Object
Function ToSubscriptionMsgSetResponse(qbXMLSubscriptionResponse As String, qbXMLMajorVersion As Integer, qbXMLMinorVersion As Integer) As Object
Function DoSubscriptionRequests(request As Object) As Object
Function DoSubscriptionRequestsFromXMLString(qbXMLSubscriptionRequest As String) As Object
Function ToEventsMsgSet(qbXMLEventsResponse As String, qbXMLMajorVersion As Integer, qbXMLMinorVersion As Integer) As Object
Function ToMsgSetRequest(qbXMLRequest As String) As Object
Function IsErrorRecoveryInfo() As Boolean
Sub ClearErrorRecovery()
Let EnableErrorRecovery(Boolean)
Get EnableErrorRecovery() As Boolean
Let SaveAllMsgSetRequestInfo(Boolean)
Get SaveAllMsgSetRequestInfo() As Boolean
Function GetErrorRecoveryStatus() As Object
Function GetSavedMsgSetRequest() As Object
Get ErrorRecoveryID() As Object
Get ConnectionType() As ENConnectionType
Sub OpenConnection2(AppID As String, AppName As String, connType As ENConnectionType)
Get QBAuthPreferences() As Object
Sub CommunicateOutOfProcess(useOutOfProc As Boolean)
Sub CommunicateOutOfProcessEx(useOutOfProc As Boolean, outOfProcCLSID As String)
Get QBXMLVersionsForSubscription() As Array

--- Code: Script BASIC ---import oQBSession = CreateObject("QBFC13.QBSessionManager") print "Typename = ", TypeName(oQBSession), "\n" print "Launching DescribeInterface dialog...\n"DescribeInterface oQBSession  print "Shutting down QuickBooks and releasing object...\n"CallByName(oQBSession, "Quit")ReleaseObject(oQBSession) 
According to the interface viewer, BeginSession is a SUB and doesn't return a value.

I also found this reference for the QBFC13.dll. (QuickBooks SDK Foundation Classes)

I found this code snippet in the QBFC Programmers Guide.

--- Quote ---Some Commentary on the QBFC Code Snippet

The same commentary provided for the qbXML snippet above applies here. One interesting difference you’ll notice is the absence of the session ticket when you use QBFC. That is managed automatically by QBFC

--- End quote ---


I think I'm close. All I need to do now is figure out how to return a string response from the object being returned. I know it's working due to the delay reading the QuickBooks database and building the response buffer.

--- Code: Script BASIC ---import oqbXMLRP = CreateObject("QBFC13.QBSessionManager.1")PRINT "oqbXMLRP: ", oqbXMLRP,"\n" CallByName(oqbXMLRP, "OpenConnection", vbMethod, "", "Script BASIC")CallByName(oqbXMLRP, "BeginSession", vbMethod, "", 2) xml_request = """<?qbxml version="8.0"?><QBXML>   <QBXMLMsgsRq onError="stopOnError">      <AccountQueryRq requestID="1">      </AccountQueryRq>   </QBXMLMsgsRq></QBXML>""" response = CallByName(oqbXMLRP, "DoRequestsFromXMLString", vbMethod, xml_request) PRINT response,"\n" CallByName(oqbXMLRP, "EndSession", vbMethod)CallByName(oqbXMLRP, "CloseConnection", vbMethod) 

oqbXMLRP: 22304124


QBFC Quick Reference


--- Code: Script BASIC ---IMPORT oqbXMLRP = VBNEW("QBFC13.QBSessionManager.1")VBCALL oqbXMLRP, "OpenConnection", vbMethod, "", "Script BASIC"VBCALL oqbXMLRP, "BeginSession", vbMethod, "", 2 xml_request = """<?qbxml version="8.0"?><QBXML>   <QBXMLMsgsRq onError="stopOnError">      <AccountQueryRq requestID="1">      </AccountQueryRq>   </QBXMLMsgsRq></QBXML>""" oResponse = VBCALL(oqbXMLRP, "DoRequestsFromXMLString", vbMethod, xml_request)xml_str = VBCALL(oResponse, "ToXMLString", vbMethod) PRINT xml_str,"\n" VBCALL oqbXMLRP, "EndSession", vbMethodVBCALL oqbXMLRP, "CloseConnection", vbMethodVBREL oResponseVBREL oqbXMLRP 

Note: Full response too large to post. This is the end of the response string returned.

<Name>Purchase Orders</Name>
<FullName>Purchase Orders</FullName>
<Name>Sales Orders</Name>
<FullName>Sales Orders</FullName>


Mike Lobanovsky:
Congrats! :)


[0] Message Index

[#] Next page

[*] Previous page

Go to full version