Bug #8326 Fatal Error Using MyODBC with MS Visual Foxpro 8
Submitted: 4 Feb 2005 20:10 Modified: 5 Feb 2005 15:43
Reporter: Tom Gadue Email Updates:
Status: Can't repeat Impact on me:
None 
Category:Connector / ODBC Severity:S1 (Critical)
Version:MySQL 4.1 OS:Windows (XP SP1)
Assigned to: CPU Architecture:Any

[4 Feb 2005 20:10] Tom Gadue
Description:
This fatal error is received when just doing a SQLCONNECT() using a DSN

Fatal error: Exception code=C0000005 @ 02/04/2005 01:40:45 PM. Error log file: C:\Program Files\Common Files\Microsoft Shared\VFP\vfp8rerr.log
	Called from -  form1.cmd1.click line 12  {c:\data\vfp\tbasicsql\frm1.sct c:\data\vfp\tbasicsql\frm1.sct}
	Called from -  kmain line 96  {C:\Data\vfp\tbasicsql\kmain.prg c:\data\vfp\tbasicsql\odbctest.exe}

I have found no workaround and no solution to this problem.

How to repeat:
1. Using the Windows ODBC Data Source Administrator create a DSN to your MySQL DB.

2. Include this Visual Foxpro 8 code in a method (I will supply a test VFP project that fails)

myconnect = SQLCONNECT('tomsql')

IF myconnect <= 0
	MESSAGEBOX("Connection Did Not Work")
ELSE
	SQLDISCONNECT(myconnect)
ENDIF

3. When this piece of code is run the fatal error will occur.  You can try the code by simply running the exe provided in the zip file.  Click the button that pops up and that contains the code above.  You should then get the error.
[4 Feb 2005 20:12] Tom Gadue
Visual Foxpro 8 project and executable, unzip and run

Attachment: vfp8_odbcbug.zip (application/x-zip-compressed, text), 14.45 KiB.

[4 Feb 2005 20:26] Tom Gadue
When creating the DSN make sure you include all necessary info such as user id, password, server address (I was using localhost), and leave the port as 3306 because any other port will not work (already report as a mysql bug)
[5 Feb 2005 1:02] Tom Gadue
I am using MySQL Server 4.1 and MyODBC 3.51 (just downloaded on Feb 2, 2005)
[5 Feb 2005 15:43] Jorge del Conde
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

Additional info:

I was unable to reproduce this bug (Visual Fox Pro 9) using a development release of MyODBC.  This bug will be fixed in our next MyODBC release.