Forums
This topic is locked
ASP and MySQL error...
Posted 06 Jun 2003 14:56:50
1
has voted
06 Jun 2003 14:56:50 David Behan posted:
Hi,Just upsizing a cms to work with MySQL. All is working fine, including dates, deletes, etc. but I am getting this error on one of my pages. Any ideas:
<font color=red>
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[MySQL][ODBC 3.51 Driver][mysqld-4.0.13-nt]You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(stat_day) AS AllHits FROM tbl_stats_property' at line 1
stats_year.asp, line 38
</font id=red>
The snippet of ASP code that is generating the error is:
<font color=red>
set rsTotalHits = Server.CreateObject("ADODB.Recordset"

rsTotalHits.ActiveConnection = dbase_source
rsTotalHits.Source = "SELECT COUNT (stat_day) AS AllHits FROM " & tablestats <font color=blue>It something to do with this line but I can't see anything wrong. I tried loads of different things.</font id=blue>
rsTotalHits.CursorType = 0
rsTotalHits.CursorLocation = 2
rsTotalHits.LockType = 3
rsTotalHits.Open()
rsTotalHits_numRows = 0
</font id=red>
Any help would be much appreciated.
Thanks,
Dave
_________________________
WinXP : IIS 5.1 : StudioMX : ASP : VBScript
www.dynamic.ie
Replies
Replied 10 Jun 2003 10:05:41
10 Jun 2003 10:05:41 Julio Taylor replied:
I'm not sure exactly what the problem is here, beano, but if it's any use, did you upgrade this siute from MSQL / Access to MySQL by any chance? I know that there are some things (such as curdate()) that don't transport accross different DB platforms.
From what i can see the problem is in the SQL not in the ASP script itself, i think you should review your queries, maybe test them in the database environment alone first?
let me know how you get on.
------------------------
Julio
PHP | MySQL | DWMX
ICQ: 19735247
MSN:
From what i can see the problem is in the SQL not in the ASP script itself, i think you should review your queries, maybe test them in the database environment alone first?
let me know how you get on.
------------------------
Julio
PHP | MySQL | DWMX
ICQ: 19735247
MSN:
Replied 10 Jun 2003 14:24:53
10 Jun 2003 14:24:53 Mark Tait replied:
Hi - try count(*) and see if that has any effect...
Mark Tait
Mark Tait