I use VFP to view data (remote views) from our billing software,
Medisoft,which uses Advantage StremalineSQL ODBC.

While I use VFP 6.0 I had no problems creating and modifying the remote
After I upgraded to VFP 8.0 I can only browse the remote views(there is
but I can't create new ones or modify the old ones.

Always get the same error :

AppName: vfp8.exe AppVer: ModName: adsodbc.dll
ModVer: Offset: 0002bdac

Fatal error: Exception code=C0000005 @ 06/03/03 09:39:41 AM. Error log file:
C:\Program Files\Microsoft Visual FoxPro 8\vfp8err.log

I did get a response from Advantage but I would have to pay $195 just to
review the problem.
I tried Medisoft with no luck

I tried Microsoft and within a few days I got this reponse :

Hi Fernando,

I got some further info on this error from the VFP development team. The
exception happens when VFP calls the ODBC function SQLExecDirect with an
empty command argument. This is done to clear any prepared statements from
the ODBC statement handle. There may be a prepared statement associated with
that handle, and VFP needs to issue the SQLExecDirect to ensure the
statement handle is in a correct state to proceed with subsequent ODBC
function calls. This code was added to VFP8 to prevent other problems with
creating views. According to the development, versions of VFP prior to VFP8
call SQLExecDirect() with an empty command argument in other places, but not
when creating views.

The Advantage ODBC driver doesn't know how to deal with an empty
SQLExecDirect() function call, and crashes.

You can also reproduce the crash with this code in VFP8, VFP7, VFP6:

lnHandle = SQLConnect('advantage dsn name')

No other ODBC driver I have tested with or that I know of (other than the
Advantage driver) crashes under these circumstances.

I also tested with the latest available Advantage driver I could obtain from
their web site, v 7.0, and see the same behavior. I also tested extensively
to try to come up with a workaround, and I was unable to create or edit a
remote view created with the Advantage driver.

Here is the ODBC trace when the error happens:

vfp8 8d4-c9c ENTER SQLFreeStmt
HSTMT 01B92108

vfp8 8d4-c9c EXIT SQLFreeStmt with return code 0 (SQL_SUCCESS)
HSTMT 01B92108

vfp8 8d4-c9c ENTER SQLExecDirect
HSTMT 01B92108
UCHAR * 0x008AF6B0 [ -3] "\ 0"

Here is a trace from the VFP ODBC driver, which does not exhibit the crash:

vfp8 938-9a8 EXIT SQLFreeStmt with return code 0 (SQL_SUCCESS)
HSTMT 01B92078

vfp8 938-9a8 ENTER SQLExecDirect
HSTMT 01B92078
UCHAR * 0x008AF6B0 [ -3] "\ 0"

vfp8 938-9a8 EXIT SQLExecDirect with return code -1 (SQL_ERROR)
HSTMT 01B92078
UCHAR * 0x008AF6B0 [ -3] "\ 0"

DIAG [S1009] [Microsoft][ODBC Visual FoxPro Driver]Invalid argument value

vfp8 938-9a8 ENTER SQLPrepare
HSTMT 01B92078
UCHAR * 0x01057B68 [ -3] "SELECT * FROM foxuser\ 0"

We don't have any plans to change VFP to special-case for the Advantage
driver. I would recommend contacting Advantage with the information above to
let them know that it is our view that the problem lies with their driver.

Anyone care to comment about this.. Any solution in sight ?