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 : Closing the QB session?Search Forum

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

 New Topic 
 
 Post Reply 
[1]  
 Closing the QB session? 
 Author   Message 
  Greg Pierce 
  
 Group: Members 
 Posts: 1 
 Joined: 2007-05-15 
 Profile
 Posted : 2007-05-15 23:28:27
Is there a specific call/SP that closes the session with QB?

I'm working on a app that uses QODBC and I keep getting left with open sessions somehow and am unable to quit QB.

Ideas are welcome, thanks!

greg. 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2007-05-16 23:48:27

You simply need to disconnect to close your connection, for example the oConnection.Close line in this VB Script example:

See an Account detail

Const adOpenStatic = 3
Const adLockOptimistic = 3
Const adUseClient = 3

Dim oConnection
Dim oRecordset
Dim sLastVendor
Dim dTotalApplied
Dim dAmountDue
Dim fname

Set oConnection = CreateObject("ADODB.Connection")
Set oRecordset = CreateObject("ADODB.Recordset")

fname=InputBox("Enter the Name:")
'fname=InputBox("Enter the ListID:")


oConnection.Open "DSN=Quickbooks Data;OLE DB Services=-2"
oRecordset.CursorLocation = adUseClient

oRecordset.Open "SELECT * FROM Account WHERE Name = '" & fname & "'" , oConnection, adOpenStatic, adLockOptimistic
'oRecordset.Open "SELECT * FROM Account WHERE ListID = '" & fname & "'" , oConnection, adOpenStatic, adLockOptimistic

if (not oRecordset.EOF) Then

MsgBox oRecordSet.Fields("ListID")
'MsgBox oRecordSet.Fields("Name")

else

MsgBox "SORRY - NO ROWS WHERE FOUND"
end if

oRecordset.Close
oConnection.Close

 

  Top 
 New Topic 
 
 Post Reply 
[1]  

Jump to