Bug #3960 | Max(DateType) wrong with ADO recordset | ||
---|---|---|---|
Submitted: | 2 Jun 2004 7:33 | Modified: | 21 Mar 2007 10:26 |
Reporter: | [ name withheld ] | Email Updates: | |
Status: | Can't repeat | Impact on me: | |
Category: | Connector / ODBC | Severity: | S3 (Non-critical) |
Version: | 3.51.07 | OS: | Windows (Window 2K) |
Assigned to: | CPU Architecture: | Any |
[2 Jun 2004 7:33]
[ name withheld ]
[21 Mar 2007 10:26]
Tonci Grgin
Hi and thanks for your report. We appologize for the delay, somehow this report got neglected... Please upgrade to MyODBC 3.51.14: - MySQL server 5.0.38BK on WinXP Pro SP2 localhost - MyODBC 3.51.14GA - 400000 records table "dnevnik" with "Datum1" being DATE field in database "solusd". 25000+ rows in table "sysinsertvp" with "TS" being TIMESTAMP field. - MS generic ODBC client, ODBCte32.exe --Test-- Full Connect(Use Driver) Env. Attr. SQL_ATTR_ODBC_VERSION set to SQL_OV_ODBC3 Successfully connected to DSN 'myodbc1'. SQLExecDirect: In: hstmt = 0x008B1960, szSqlStr = "use solusd", cbSqlStr = -3 Return: SQL_SUCCESS=0 SQLExecDirect: In: hstmt = 0x008B1960, szSqlStr = "SELECT MAX(Datum1) FROM solusd.dnevnik", cbSqlStr = -3 Return: SQL_SUCCESS=0 Get Data All: "MAX(Datum1)" 2066-04-01 1 row fetched from 1 column. SQLExecDirect: In: hstmt = 0x008B1960, szSqlStr = "SELECT MAX(TS) FROM solusd.sysinsertvp", cbSqlStr = -3 Return: SQL_SUCCESS=0 Get Data All: "MAX(TS)" 2006-08-29 14:54:12 1 row fetched from 1 column.
[3 Apr 2007 9:57]
Tonci Grgin
ADO VB test produces correct result too: Dim cx As New ADODB.Connection Dim rs As New ADODB.Recordset cx.ConnectionString = "DSN=myodbc1sd" cx.Open() rs.Open("SELECT MAX(Datum1) FROM solusd.dnevnik", cx, CursorTypeEnum.adOpenForwardOnly, LockTypeEnum.adLockOptimistic) Dim oField As ADODB.Field Dim oStr As String oStr = "" Do Until rs.EOF For Each oField In rs.Fields oStr = oStr & (oField.Value) & "," Next MsgBox(oStr) oStr = "" rs.MoveNext() Loop rs.Close() rs.Open("SELECT MAX(TS) FROM solusd.sysinsertvp", cx, CursorTypeEnum.adOpenForwardOnly, LockTypeEnum.adLockOptimistic) oStr = "" Do Until rs.EOF For Each oField In rs.Fields oStr = oStr & (oField.Value) & "," Next MsgBox(oStr) oStr = "" rs.MoveNext() Loop rs.Close()