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 : Should I be able to select the Charge tableSearch Forum

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

 New Topic 
 
 Post Reply 
[1]  
 Should I be able to select the Charge table 
 Author   Message 
  mkettner 
  
 Group: Members 
 Posts: 8 
 Joined: 2006-11-01 
 Profile
 Posted : 2006-12-09 06:03:19

We recently purchased the read/write version of Qodbc. We need to update the Charge table. We tried to use MSaccess (see previous post) and it didn't work. We were unable to access the charge table.

I have tried to adapt the Employee table sample code to select data from the Charge table base on TxnId or TxnNumber. I can run the Employee table code without a hitch. The Charge table code below does not work. A little help ?

Thank You.

This works as expected:

sub cmdEmployeeTable_click()

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

Dim oConnection
Dim oRecordset
Dim sMsg

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

oConnection.Open "DSN=Quickbooks Data;"

oRecordset.CursorLocation = adUseClient
oRecordset.Open "SELECT * FROM Employee" , oConnection, adOpenStatic, adLockOptimistic
sMsg = "************************" & vbCrLf
sMsg = sMsg & "QODBC Driver Test Result:" & vbCrLf
sMsg = sMsg & "QuickBooks Employee List:" & vbCrLf
Do While (not oRecordset.EOF)
sMsg = sMsg & " " & oRecordSet.Fields("Name") & vbCrLf
oRecordset.MoveNext
Loop

sMsg = sMsg & "************************" & vbCrLf
MsgBox sMsg


oRecordset.Close
oConnection.Close

end sub

This produces an empty oRecordset:

sub cmdChargeTable_click()

Const adOpenStatic = 3

Const adLockOptimistic = 3

Const adUseClient = 3

Dim oConnection

Dim oRecordset

Dim sMsg

set oConnection = CreateObject("ADODB.Connection")

set oRecordset = CreateObject("ADODB.Recordset")

oConnection.Open "DSN=Quickbooks Data;OpenMode=S;OLE DB Services=-2;"

oRecordset.CursorLocation = adUseClient

oRecordset.Open "SELECT * FROM Charge" , oConnection, adOpenStatic, adLockOptimistic

oRecordset.Open "SELECT TxnID,TxnNumber,""Desc"" FROM Charge WHERE TxnNumber>90501" , oConnection, adOpenStatic, adLockOptimistic

sMsg = "************************" & vbCrLf

sMsg = sMsg & "QODBC Result:" & vbCrLf

sMsg = sMsg & "SELECT * FROM Charge" & vbCrLf

Do While (not oRecordset.EOF)

sMsg = sMsg & " " & oRecordSet.Fields("TxnID") & vbCrLf

oRecordset.MoveNext

Loop

sMsg = sMsg & "************************" & vbCrLf

MsgBox sMsg

oRecordset.Close

oConnection.Close

end sub

 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2006-12-09 08:03:20

You have two oRecordset.Open lines in your example. I ran:

SELECT TxnID,TxnNumber,"Desc" FROM Charge WHERE TxnNumber>1000

and got Statement Charges returned.

 

  Top 
  mkettner 
  
 Group: Members 
 Posts: 8 
 Joined: 2006-11-01 
 Profile
 Posted : 2006-12-12 03:56:44

Sorry for the confusion.  Yes, there are two Open statements for the charge table.  I have tried each one (one at a time) and neither work.  I tried your query (> 1000) in VB demo and got 39 results.  When I try to run the same query using the above script, I get no results.

Also, the above script works for the employee table but NOT for the charge table.

Thanks!

 

  Top 
 New Topic 
 
 Post Reply 
[1]  

Jump to