>**** Set up MYOB connection string for read-write access >thisform.r_cConnStr = ; >"DSN=myob;" + ; >"DRIVER_COMPLETION=DRIVER_NOPROMPT;" + ; >"ACCESS_TYPE=READ_WRITE;" + ; >"IDENTIFY_BY=CARD_ID;" + ; >"INSERT_TYPE=REJECT_DUPLICATES;" + ; >"SUPPRESS_WARNING=TRUE;" > >**** Make the connection >thisform.r_nConnHandle = SQLSTRINGCONNECT(thisform.r_cConnStr ,.T.) >IF thisform.r_nConnHandle <= 0 >= MESSAGEBOX('Error connecting to MYOB data source.', MB_ICONSTOP, 'MYOB Connection Error') >RETURN .F. >ENDIF >lnRes = sqlsetprop(thisform.r_nConnHandle, 'DispLogin', 3) && Set ODBC login Never >lnRes = sqlsetprop(thisform.r_nConnHandle, 'Asynchronous', .F.) && Results returned asynchronously >lnRes = sqlsetprop(thisform.r_nConnHandle, 'BatchMode', .T.) && Result sets returned all at once > >WAIT WINDOW "Retrieving all MYOB cusomers..." nowait >lnRes = SQLEXEC(thisform.r_nConnHandle, 'SELECT * FROM MYOB.customers', 'vCustomers') >* >*--- The above command succeeds and all Customers are returned >* >lcSql = "INSERT INTO Import_Consolidated_Taxcodes VALUES ('TST','','WET')" >lnRes = SQLEXEC(thisform.r_nConnHandle, lcSQL) >* >*--- The above insert statement fails (lnRes = -1) >* >>Any suggestions would be most gratefully received,