I have been testing an application that uses SQL Pass Through (SPT) with SQL Server under VFP 8.
A range of what appear to be undocumented behaviour changes, errors and bugs have emerged in VFP8. The problems do not appear under VFP6/7. All updates back to the SQL Server are handled manually, so the SPT cursors do not need to carry out any form of updating.
1. When creating a cursor using a command similar to SQLEXEC(m.SqlHandle, "SELECT * FROM test", "test") empty memo fields are returned. I do not know if this is connected to the "FetchMemo" property, but can find no way to set this before returning results.
2. When I attempt to look at a memo field in the cursor the error 'No update tables are specified. Use the Tables property of the cursor (Error 1491)' is returned. Presumably this is connected with the issue 1 above.
3. If I reissue any further SQLEXEC commands the error 'Invalid call issued while executing a SQLMORERESULTS( ) sequence (Error 1475)' is returned. Again presumed to be connected with the fact that the cursor does not yet contain any memo data.
The behaviour listed above is easily replicable and demonstrably different in VFP 8 to VFP 6/7 using the following sample code. Any suggestions?
m.SqlHandle = SQLSTRINGCONNECT("Driver={Sql Server};Server=127.0.0.1;Database=northwind;UID=sa;PWD=;")
? SQLEXEC(m.SqlHandle, "SELECT * FROM employees", "employees")
? notes
? SQLEXEC(m.SqlHandle, "SELECT * FROM orders", "orders")
? SQLDISCONNECT(m.SqlHandle)