Please check my VB/MS ACCESS code syntax

linzynj
11-30-2003, 11:04 AM
Hi:

When I run the MySQL query below (without the ADO part) from inside a session of MS ACCESS it works fine and returns what I want. But when I embed the following code in a VB pgm the Recordset returns nothing. I know I must be doing something dumb ..... Help

Thanks, Lindsay



MySQL = " Select docrequested, Count(docrequested) " & _
" from WebLogData where docRequested like '*.psd*' " & _
" group by docrequested having Count(docrequested) > 0 " & _
" order by Count(docrequested) desc "

objRSet.Open MySQL, objConn, adOpenKeyset, adLockOptimistic, adCmdText
Do While Not objRSet.EOF
frmDisplayOutput.list2.AddItem objRSet("docRequested")
objRSet.MoveNext
Loop

Shurik12
11-30-2003, 11:10 AM
Hi,

Could you try:

... '%.psd%'...

Regards,
Shurik.

linzynj
11-30-2003, 11:30 AM
Thanks so much .... It always turns out to be something dumb. I know that the entire SQL world uses '%' but inside MS ACCESS it wanted '*'.

How come it wants '%' when it comes from VB but '*' from inside ACCESS?

Thanks,

Lindsay

reboot
11-30-2003, 11:35 AM
Because ADO requires %

Dennis DVR
11-30-2003, 07:04 PM
maybe it's the ansi thing

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum