Hi, I have been trying for 4 days but I can't solve this problem and I
don't know why.
It's a bug?
I have a table (children) which has a field called borough; I have to
extract the sum of the children of each borough so I use this simple
query:
select count(*) , borough from children group by borough order by
borough
that works.
If I try to call this query from a VB6 project it doesn't work, that is,
it returns an empty recordset.
This is the code that I'm using
Dim rec As ADODB.Recordset
Dim cnn As ADODB.Connection
Dim cmd As ADODB.Command
Dim GlConnString as String
Dim strSQL As String
Set rec = New ADODB.Recordset
Set cnn = New ADODB.Connection
Set cmd = New ADODB.Command
strSQL = select count(*) , borough from children group by borough order
by borough
GlConnString =
"server=localhost;db=MyDB;driver={MySQL};uid=root;pwd=MyPwd;OPTION=35"
cnn.CursorLocation = adUseClient
cnn.ConnectionString = GlConnString
cnn.Open
cmd.CommandType = adCmdText
cmd.CommandText = STRsql
Set cmd.ActiveConnection = cnn
Set rec = cmd.Execute
---at this point I have an empty recordset
If I try with this query
select borough from children group by borough order by borough
that is, removing count(*) works!
I'm using
Windows 2000
MySQL 3.23.49
MyODBC 2.50.39
ADO 2.52.6019.1
Help me, please!
Thanks
Teo
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php