Problem with SUM clause via ODBC ab VB6

Problem with SUM clause via ODBC ab VB6

am 20.08.2005 13:56:56 von e.didomenico

My configuration is:
MySQL Query Browser 1.1.13
MySQL 5.0.10a-beta-nt
MySQL client 5.0.4
MySQL ODBC 5.51 Driver 3.51.11.00
Windows 2000 Pro
MDAC_Type 2.81


This simple query
"SELECT SUM(sub_tot) as totale FROM rg"
work fine on MySQL Query Browser 1.1.13
result 3456.87

when I execute the same query in VB 6.0

Dim MySQLConn As ADODB.Connection
Set MySQLConn = New ADODB.Connection
MySQLConn.Open "MySql_collettore"

Dim rst As New ADODB.Recordset

rst.Open "SELECT SUM(sub_tot) as totale FROM rg", MySQLConn
Do While Not rst.EOF
MsgBox rst("totale")
rst.MoveNext
Loop

it return an empty recordset rst.

Why ???

Tanks



--
MySQL ODBC Mailing List
For list archives: http://lists.mysql.com/myodbc
To unsubscribe: http://lists.mysql.com/myodbc?unsub=gcdmo-myodbc@m.gmane.org

Re: Problem with SUM clause via ODBC ab VB6

am 20.08.2005 15:11:46 von Fabio Venditti

Hi

I solved similar problems and maybe solution is the same for your.
When i upgraded my MySQL server some timestamp fields changed their values
to "0000-00-00" ... so when i tried to get recordsets by VB6 i obtained EOF
or data connection errors.

Maybe you have zero-filled fields in your rg table and it prevents you to
obtain a recordset from ADO driven queries.
My solution was to delete 'autoincrement' fields.
If you need to use such types then you'll prefer to check and modify
standard values for NULL fields.
Hope this solve your problem.

Ciao.


----- Original Message -----
From:
To:
Sent: Saturday, August 20, 2005 1:56 PM
Subject: Problem with SUM clause via ODBC ab VB6


>
> My configuration is:
> MySQL Query Browser 1.1.13
> MySQL 5.0.10a-beta-nt
> MySQL client 5.0.4
> MySQL ODBC 5.51 Driver 3.51.11.00
> Windows 2000 Pro
> MDAC_Type 2.81
>
>
> This simple query
> "SELECT SUM(sub_tot) as totale FROM rg"
> work fine on MySQL Query Browser 1.1.13
> result 3456.87
>
> when I execute the same query in VB 6.0
>
> Dim MySQLConn As ADODB.Connection
> Set MySQLConn = New ADODB.Connection
> MySQLConn.Open "MySql_collettore"
>
> Dim rst As New ADODB.Recordset
>
> rst.Open "SELECT SUM(sub_tot) as totale FROM rg", MySQLConn
> Do While Not rst.EOF
> MsgBox rst("totale")
> rst.MoveNext
> Loop
>
> it return an empty recordset rst.
>
> Why ???
>
> Tanks
>
>
>
> --
> MySQL ODBC Mailing List
> For list archives: http://lists.mysql.com/myodbc
> To unsubscribe: http://lists.mysql.com/myodbc?unsub=venditti@tiscali.it
>
>



--
MySQL ODBC Mailing List
For list archives: http://lists.mysql.com/myodbc
To unsubscribe: http://lists.mysql.com/myodbc?unsub=gcdmo-myodbc@m.gmane.org

Re: Problem with SUM clause via ODBC ab VB6

am 20.08.2005 15:21:13 von e.didomenico

Hi,

thanks for the help, but the field in question is a double, not
autoincrement, 0 default value, and all records not contains null.
This bug is reported in mysql bug, but there isn't an answer to the
question.

Thank a lot.

EDD
----- Original Message -----
From: "Fabio Venditti"
To:
Cc:
Sent: Saturday, August 20, 2005 3:11 PM
Subject: Re: Problem with SUM clause via ODBC ab VB6


> Hi
>
> I solved similar problems and maybe solution is the same for your.
> When i upgraded my MySQL server some timestamp fields changed their values
> to "0000-00-00" ... so when i tried to get recordsets by VB6 i obtained
EOF
> or data connection errors.
>
> Maybe you have zero-filled fields in your rg table and it prevents you to
> obtain a recordset from ADO driven queries.
> My solution was to delete 'autoincrement' fields.
> If you need to use such types then you'll prefer to check and modify
> standard values for NULL fields.
> Hope this solve your problem.
>
> Ciao.
>
>
> ----- Original Message -----
> From:
> To:
> Sent: Saturday, August 20, 2005 1:56 PM
> Subject: Problem with SUM clause via ODBC ab VB6
>
>
> >
> > My configuration is:
> > MySQL Query Browser 1.1.13
> > MySQL 5.0.10a-beta-nt
> > MySQL client 5.0.4
> > MySQL ODBC 5.51 Driver 3.51.11.00
> > Windows 2000 Pro
> > MDAC_Type 2.81
> >
> >
> > This simple query
> > "SELECT SUM(sub_tot) as totale FROM rg"
> > work fine on MySQL Query Browser 1.1.13
> > result 3456.87
> >
> > when I execute the same query in VB 6.0
> >
> > Dim MySQLConn As ADODB.Connection
> > Set MySQLConn = New ADODB.Connection
> > MySQLConn.Open "MySql_collettore"
> >
> > Dim rst As New ADODB.Recordset
> >
> > rst.Open "SELECT SUM(sub_tot) as totale FROM rg", MySQLConn
> > Do While Not rst.EOF
> > MsgBox rst("totale")
> > rst.MoveNext
> > Loop
> >
> > it return an empty recordset rst.
> >
> > Why ???
> >
> > Tanks
> >
> >
> >
> > --
> > MySQL ODBC Mailing List
> > For list archives: http://lists.mysql.com/myodbc
> > To unsubscribe:
http://lists.mysql.com/myodbc?unsub=venditti@tiscali.it
> >
> >
>
>
>


--
MySQL ODBC Mailing List
For list archives: http://lists.mysql.com/myodbc
To unsubscribe: http://lists.mysql.com/myodbc?unsub=gcdmo-myodbc@m.gmane.org