Hi,
I have a short VB script that pulls info from the Customer table and ultimately will dump it into a MySQL table. The code I have is based on the examples on the QODBC site.
I'm getting a "[QODBC] INvalid bookmark value" (code 80040E0E) in the middle of the script (line 17, char 1, as soon as it tries to dump the result into an array)
Windows 2000, QB v6 Enterprise edition, QODBC 7, connections all test fine and my SQL query works fine in the test app as well.
Is the QODBC 7 vs. QB v6 the problem? Should I be using QODBC 6?
Code is below:
Dim oConnection Dim oRecordset Dim sMsg Dim sConnectString Dim sSQL sConnectString = "DSN=Quickbooks Data;OLE DB Services=-2;" sSQL = "SELECT Name,ParentRefFullName,contact,IsActive FROM Customer UNOPTIMIZED WHERE ParentRefListID<>''" Set oConnection = CreateObject("ADODB.Connection") Set oRecordset = CreateObject("ADODB.Recordset")
oConnection.Open sConnectString oRecordset.Open sSQL, oConnection, adOpenStatic, adLockOptimistic recordsarray=oRecordSet.GetRows()
oRecordset.Close Set oRecordset = Nothing oConnection.Close Set oConnection = Nothing
'sConnectString = "DSN=Quickbooks Import" 'Set oConnection = CreateObject("ADODB.Connection") 'Set oRecordset = CreateObject("ADODB.Recordset") oConnection.Open sConnectString
i=0
Do While (not i=11) 'sqltext="INSERT INTO customer (project,customer) VALUES ('" & recordsarray(i,0) &"','" & recordsarray(i,1) & "')"
echo recordsarray(i,0)
'oConnection.execute sqltext i=i+1 Loop
oConnection.Close Set oConnection = Nothing MsgBox("OK") |