Jump to content

creating qbXML object


Particle
 Share

Recommended Posts

Basically, I can't seem to get the object to create successfully. I've looked at the SDK guide and Au3 forums and I have Quickbooks SDK 10.0 installed, but when trying to read and interpret the VB code from the guide to access Quickbooks using qbXML it doesn't work.

Here is the vb portion:

Dim MyQbXMLRP2 As QBXMLRP2Lib.RequestProcessor2
Set MyQbXMLRP2 = New QBXMLRP2Lib.RequestProcessor2

And when I try to run this code it errors:

$session = ObjCreate("QBXMLRP2Lib.RequestProcessor2")
If Not IsObj($session) Then
    MsgBox(0, "ERROR", "Unable to create object.")
    Exit
EndIf

Is there something i'm missing, doing, or interpreting wrong?

(Note: I've also tried $session = ObjCreate("QBXMLRP2Lib") and that didn't work either)

Link to comment
Share on other sites

G'day

Have you tried the script at #793435.

I didn't know the SDK existed and a big thanks for that!

The only trouble I had is I can't download the SDK until I "register" but the registration page isn't working. ;)

When/IF the registration screen is up again I'll download the SDK and have a play.

I use "Quickbooks Pro 2010-11" and a nice Autoit front end for standard invoices would be great.

Thanks

Link to comment
Share on other sites

G'day

Have you tried the script at #793435.

I didn't know the SDK existed and a big thanks for that!

The only trouble I had is I can't download the SDK until I "register" but the registration page isn't working. ;)

When/IF the registration screen is up again I'll download the SDK and have a play.

I use "Quickbooks Pro 2010-11" and a nice Autoit front end for standard invoices would be great.

Thanks

Yeah I tried that too, still not working...

Link to comment
Share on other sites

Yeah I tried that too, still not working...

Sigh... I finally logged into the dev centre and got the SDK so I'll give it a try when I get a moment to spare.

If you solve it let me know (as I will to you). I've got so many ideas with the SDK that I'd like to try.....sigh

Good Luck

Link to comment
Share on other sites

Sigh... I finally logged into the dev centre and got the SDK so I'll give it a try when I get a moment to spare.

If you solve it let me know (as I will to you). I've got so many ideas with the SDK that I'd like to try.....sigh

Good Luck

Okay thanks, I'll be around all day so I will try everything I can think of. Must be something small I'm overlooking.

Link to comment
Share on other sites

I still don't understand what's going on, the PDF guide lays it out pretty easily on how it's to be done.

From QBSDK_ProGuide.pdf:

1.Open a connection to QuickBooks.

2.Start a session for working on a specific QuickBooks company file.

3.Send whatever requests you want to do something in QuickBooks.

4.When you’re done or before your application exits, end the session.

5.Then close the connection.

VB Code Snippets for Access if You Use qbXML

If you use qbXML, you need to use QBXMLRP2Lib, however your language does this,

such as by an import statement, or by specifying it in your project reference, Then, here’s

what the above steps 1 through 5 look like in code:

Dim MyQbXMLRP2 As QBXMLRP2Lib.RequestProcessor2

Set MyQbXMLRP2 = New QBXMLRP2Lib.RequestProcessor2

MyQbXMLRP2.OpenConnection2 "", "My Sample App", localQBD

Dim ticket As String

ticket = MyQbXMLRP2.BeginSession("", QBXMLRP2Lib.qbFileOpenDoNotCare)

‘ The variable “xml” here is a fully formed message request set:

‘ we left out that part to keep this as simple as possible

Dim sendXMLtoQB As String

sendXMLtoQB = MyQbXMLRP2.ProcessRequest(ticket, xml)

MyQbXMLRP2.EndSession ticket

MyQbXMLRP2.CloseConnection

When I try to interpret the VB to Au3 (and assuming this is correct for creating the object part):

$session = ObjCreate("QBXMLRP2Lib.RequestProcessor2")
If Not IsObj($session) Then
    MsgBox(0, "ERROR", "Unable to create object.")
    Exit
EndIf

It errors when I run the Au3. I've reinstalled QuickBooks Pro 2009, reinstalled QBSDK, ran the reboot.bat in QB2009 folder, ran the QBXMLRP2Installer (C:\Program Files (x86)\Intuit\IDN\QBSDK10.0\tools\installers), and restarted computer... Yet it still errors. Can someone help?

Link to comment
Share on other sites

  • 3 months later...

Well I've been busy recently, but now i'm back revisiting this project. Once again i'm using Quickbooks Pro 2009 with SDK 10.0. When I run the VB6 SDK Test program from their website it works just fine. I cannot figure out how to get the object to create in Au3. I've tried all sorts of ways to get this to work and every single one fails. I need some major help please!!!

Here is my Au3 test file:

#RequireAdmin
$session = ObjCreate("QBXMLRP2Lib.RequestProcessor2")
If Not IsObj($session) Then
    MsgBox(0, "ERROR", "Unable to create object.")
    Exit
EndIf

Here are a few that i've tried that didn't work:

ObjCreate("QBXMLRP2Lib.RequestProcessor2.1")
ObjCreate("QBXMLRP2Lib.RequestProcessor2")
ObjCreate("QBXMLRP2Lib")
ObjCreate("QBXMLRP")
ObjCreate("QBXMLRP2")

Here is the working VB6 code I tried to interpret (Note: This code is from the SDK Test I linked to their website above):

Attribute VB_Name = "qbooks"
'
' Copyright © 2002-2010 Intuit Inc. All rights reserved.
' Use is subject to the terms specified at:
'      http://developer.intuit.com/legal/devsite_tos.html
'
' $Id: qbooks.bas,v 1.1 2002/08/05 12:55:40 giza Exp $
'
Option Explicit
'
' Deliver the qbXML request to QuickBooks and return the
' response.
'
Public Function post(xmlStream As String) As String

    On Error GoTo errHandler
    
    ' Open connection to qbXMLRP COM
    Dim qbXMLRP As New QBXMLRP2Lib.RequestProcessor2
    Dim connType As QBXMLRP2Lib.QBXMLRPConnectionType
    connType = localQBD
    If (UIForm.UseQBOE) Then
        connType = remoteQBOE
    End If
    qbXMLRP.OpenConnection2 "", "SDKTest", connType
        
        
    ' Begin Session
    ' Pass empty string for the data file name to use the currently
    ' open data file.
    Dim ticket  As String
    ticket = qbXMLRP.BeginSession("", QBXMLRP2Lib.qbFileOpenDoNotCare)
        
    ' Send request to QuickBooks
    post = qbXMLRP.ProcessRequest(ticket, xmlStream)
    
    ' End the session
    qbXMLRP.EndSession ticket
    
    ' Close the connection
    qbXMLRP.CloseConnection
    Exit Function
    
errHandler:
    post = ""
    Log.out (Err.Description)
End Function

Someone please help :)

Link to comment
Share on other sites

If I hear you've PMed anybody else directing them to this thread your thread will be locked and you will be removed from the forum for a time. Believe it or not, I'm not here to serve you and answer your questions.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...