Welcome! Log In Create A New Profile

Advanced

COM / DCOM

Posted by DW 
DW
COM / DCOM
November 03, 2008 01:51AM
Hello All,

I am trying to connect to QuickBooks via COM.

I have no idea how to do this with Windev.

Here is vb code I was wondering if this can be done in Windev.

Dim SessiomMgr as QBSessionManager
Set SessionMgr = new QBSessionManager
SessionMgr.OpenConnection("","Sample QBFC")
SessionMgr.BeginSession("",onDonotCare)
SessionMgr.Endsession
SessionMgr.CloseConnection

Set SessionMgr = nothing

Any help would be appreciated

Dennis W
Fabrice Harari
Re: COM / DCOM
November 03, 2008 12:14PM
Hello Dennis...

there are several example on how to use activeX objects in WinDev (word, excel, etc.) that you can refer to for the syntax... In the help, you should find everything under automation...

Basically, the first thing to do is to find the automation object name (normally, it's written in the object documentation, but you can also find it in an automation object explorer, and even in the limited wdxview coming with windev)

Then it's just a question of using the windev syntax, and more importantly, to use the correct variable types...

Best regards

Fabrice Harari
WinDev, WebDev, WinDev Mobile consulting
KenKnight
Re: COM / DCOM
November 04, 2008 03:46AM
Hi Dennis,

This may not work, but you can try this;

autSessiomMgr is Automation Object "QBSessionManager" <- look this up in the registry
autSessionMgr>>OpenConnection("","Sample QBFC")
autSessionMgr>>BeginSession("",onDonotCare)
autSessionMgr>>Endsession
autSessionMgr>>CloseConnection

or

autSessiomMgr is Automation Object dynamic
autSessionMgr = new Automation Object "QBSessionManager"
autSessionMgr>>OpenConnection("","Sample QBFC")
autSessionMgr>>BeginSession("",onDonotCare)
autSessionMgr>>Endsession
autSessionMgr>>CloseConnection

That QBSessionManager will be something like QBSessionManager.QBSession in the registry, so you'll need to look up the actual reference.

Cheers!
Ken
DW
Re: COM / DCOM
November 04, 2008 01:04PM
Hello Ken,

Thank you that did the trick...
The key was the server name that I found in the Reg. QBFC7.QBSessionManager


I have a new one you might be able to help with:

MyAuthPrefs As IAuthPreferences
Set MyAuthPrefs = SessionManager.QBAuthPreferences
MyAuthPrefs.PutIsReadOnly

Thanks again
Dennis W
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: