Bug #12405 Error with division (/) math querys with VB6
Submitted: 5 Aug 2005 21:40 Modified: 29 Jun 2007 6:47
Reporter: Luis A S Junior Camargo Email Updates:
Status: Can't repeat Impact on me:
None 
Category:Connector / ODBC Severity:S3 (Non-critical)
Version:3.51.11-2 OS:Windows (Win2k Server SP4)
Assigned to: CPU Architecture:Any

[5 Aug 2005 21:40] Luis A S Junior Camargo
Description:
The MyODBC return a error when execute a simple math division query:

For example:
select 4/2 as result

The error is:
[Microsoft][ODBC Driver Manager] Program type out of range
Number: -2147467259

I have success in this querys:

select 4-2 as result
select 4+2 as result

I use MySQL Server 5.0.10a and Visual Basic 6 SP6.

Obs: In the console or front end clients all querys are success, the error only occurrs using MyODBC and VB6.

How to repeat:
This is my example code:

Dim conn As New ADODB.Connection
Dim strConnectionString As String

strConnectionString = "Driver={MySQL ODBC 3.51 Driver}; Server=127.0.0.1; Port=3306; Database=test; UID=test; PWD=test; Option=16427"
conn.Open strConnectionString

StrSQLTest = "select 4/2 as result"
Set SQLTest = conn.Execute(StrSQLTest)
MsgBox SQLTest("result")               <= error at this line
SQLTest.Close
Set SQLTest = Nothing

Suggested fix:
I unknow.
[7 Aug 2005 9:31] Vasily Kishkin
Thanks for bug report. I was able to reproduce the bug.
My test case is attached.
[7 Aug 2005 9:32] Vasily Kishkin
Test case

Attachment: 12405.zip (application/x-zip-compressed, text), 6.03 KiB.

[7 Aug 2005 18:50] Luis A S Junior Camargo
I have run more tests and the error occurrs only in the 5.0.10a Server Version, don't occurrs in the 4.0.25.
I use Visual Basic 6 + MyODBC 3.51.11-2 and Microsoft ActiveX Data Objects 2.8 Library Reference (References at Project Menu).
I have tested with Microsoft ActiveX Data Objects 2.8 Library Reference but the error is the same.
I have submited the Visual Basic 6 Project Test Files.
[7 Aug 2005 18:52] Luis A S Junior Camargo
Visual Basic 6 Project Test

Attachment: bug12405.zip (application/x-zip-compressed, text), 1.40 KiB.

[7 Sep 2005 22:26] Luis A S Junior Camargo
The error continues with version 5.0.12
[29 Jun 2007 6:47] Georg Richter
Can't repeat. Tested with Version 3.51.16 and MySQL Server 5.0.42.
Looks like this bug was fixed by adding NEW_DECIMAL support.