SQL problem

Hi,
I am using the following code

Set hubsdb = OpenDatabase("", dbDriverComplete,
False,
"ODBC;DSN=mysqltest;UID=root;PWD=xli2310;Database=adjuster")

Set rs = hubsdb.OpenRecordset("select * FROM
personal WHERE general LIKE 'Personal%'",
dbOpenDynaset)


MsgBox (rs.RecordCount)


i get zero results back, but when i run the query in
the mysql control center, i get 10 results back.

when i change the above sql to "Select * from
personal" i get all the items from the table back.


strange?

is there a bug?


thanks

MArk




__________________________________
Yahoo! Mail - PC Magazine Editors' Choice 2005
http://mail.yahoo.com

--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32 [at] m.gmane.org
Mark Mchugh [ Mi, 16 November 2005 15:12 ] [ ID #1059967 ]

RE: SQL problem

The record count does not always give you the correct result.
Try rs.movefirst followed by rs.movelast and then check the record
count.
Or stick the results in a grid and see what's there.


Andy

-----Original Message-----
From: Mark Mchugh [mailto:mark_mch [at] yahoo.com]
Sent: 16 November 2005 14:13
To: mysql list
Subject: SQL problem


Hi,
I am using the following code

Set hubsdb =3D OpenDatabase("", dbDriverComplete,
False,
"ODBC;DSN=3Dmysqltest;UID=3Droot;PWD=3Dxli2310;Database=3Dad juster")

Set rs =3D hubsdb.OpenRecordset("select * FROM
personal WHERE general LIKE 'Personal%'",
dbOpenDynaset)


MsgBox (rs.RecordCount)


i get zero results back, but when i run the query in
the mysql control center, i get 10 results back.

when i change the above sql to "Select * from
personal" i get all the items from the table back.


strange?

is there a bug?


thanks

MArk


=09
=09
__________________________________
Yahoo! Mail - PC Magazine Editors' Choice 2005
http://mail.yahoo.com


--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=3Dgcdmw-win32 [at] m.gmane.org
andy.lawton [ Mi, 16 November 2005 16:49 ] [ ID #1059968 ]

RE: SQL problem

I think the way you are doing it, you are using the older DAO approach
and the MSDOS style wildcards.

You need to write

Set rs =3D hubsdb.OpenRecordset("select * FROM
personal WHERE general LIKE 'Personal*'",
dbOpenDynaset)

If you were using ADODB then your wildcard would be correct.

? =3D _
* =3D %

John B.

-----Original Message-----
From: Mark Mchugh [mailto:mark_mch [at] yahoo.com]
Sent: Thursday, 17 November 2005 12:43 AM
To: mysql list
Subject: SQL problem

Hi,
I am using the following code

Set hubsdb =3D OpenDatabase("", dbDriverComplete,
False,
"ODBC;DSN=3Dmysqltest;UID=3Droot;PWD=3Dxli2310;Database=3Dad juster")

Set rs =3D hubsdb.OpenRecordset("select * FROM
personal WHERE general LIKE 'Personal%'",
dbOpenDynaset)


MsgBox (rs.RecordCount)


i get zero results back, but when i run the query in
the mysql control center, i get 10 results back.

when i change the above sql to "Select * from
personal" i get all the items from the table back.


strange?

is there a bug?


thanks

MArk


=09
=09
__________________________________
Yahoo! Mail - PC Magazine Editors' Choice 2005
http://mail.yahoo.com


--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=3Dgcdmw-win32 [at] m.gmane.org
jbonnett [ Mi, 16 November 2005 23:18 ] [ ID #1059975 ]
Datenbanken » gmane.comp.db.mysql.windows » SQL problem

Vorheriges Thema: Mysql Administrator
Nächstes Thema: DAO with mysql 5.0