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 : Update vendor tableSearch Forum

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

 New Topic 
 
 Post Reply 
[1]  
 Update vendor table 
 Author   Message 
  Jim 
  
 Group: Members 
 Posts: 1 
 Joined: 2007-05-04 
 Profile
 Posted : 2007-05-04 17:39:23

I am trying to update the vendor table with the following vbscript but I keep getting the error: "530 - A field that is not supported was included in the request. The remainder of the request was processed normally, but the unsupported field was ignored."

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

Dim qConnection
Dim qRecordset
Dim sMsg
Dim sSql

Set qConnection = CreateObject("ADODB.Connection")
Set qRecordset = CreateObject("ADODB.Recordset")

qConnection.Open "DSN=Quickbooks Data;OLE DB Services=-2"
qRecordset.CursorLocation = adUseClient

  sSql = "SELECT * FROM Vendor WHERE Vendor.Name='April Honnies'"

  qRecordset.Open sSql, qConnection, adOpenStatic, adLockOptimistic

  If (qRecordset.EOF) Then
    sMsg = "April was NOT found" & Chr(10)
  Else
    sMsg = "April was found" & Chr(10)
    qRecordset.Fields("CompanyName").value = "Test User Company"
    qRecordset.Update()
  End If

  MsgBox sMsg
 
qRecordset.Close
qConnection.Close

 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2007-05-05 09:12:55

Can't see off hand what the problem is, try looking at the QODBC Message log in the QODBC Setup Screen for the SQL Statement that failed, it will show what is actually being processed. 

Here's one of my examples that does work:

Const adOpenStatic = 3
Const adLockOptimistic = 3
Const adUseClient = 3
 
Dim oConnection
Dim oRecordset
Dim sMsg
Dim Typ
 
Set oConnection = CreateObject("ADODB.Connection")
Set oRecordset = CreateObject("ADODB.Recordset")
 

oConnection.Open "DSN=Quickbooks Data;"
 
oRecordset.CursorLocation = adUseClient
oRecordset.Open "SELECT * FROM InvoiceLine where RefNumber='49'", oConnection, adOpenStatic, adLockOptimistic
sMsg = "************************" & vbCrLf
sMsg = sMsg & "QODBC Driver Test Result:" & vbCrLf
sMsg = sMsg & "Update InvoiceLine Test Script:" & vbCrLf
sMsg = sMsg & "    " & oRecordSet.Fields("CustomerRefFullName") & vbCrLf
sMsg = sMsg & "RefNumber : " & oRecordSet.Fields("RefNumber") & vbCrLf
 
Do While (not oRecordset.EOF)
        if oRecordSet.Fields("InvoiceLineSeqNo") ="2" then
              oRecordset.Fields("CustomFieldInvoiceLineOther1").Value = "999"
              oRecordset.Update
        else
        end if
              sMsg = sMsg & "InvoiceLineSeqNo : " & oRecordSet.Fields("InvoiceLineSeqNo") & vbCrLf
              sMsg = sMsg & "CustomFieldInvoiceLineOther1 : " & oRecordSet.Fields("CustomFieldInvoiceLineOther1") & vbCrLf
 oRecordset.MoveNext
Loop
sMsg = sMsg & "************************" & vbCrLf
MsgBox sMsg
oRecordset.Close
oConnection.Close

 

  Top 
 New Topic 
 
 Post Reply 
[1]  

Jump to