Why this code won't work with MySQL? It works fine with access.
<% 'Location of news database exact location on machine not web or you can use a system DSN name dbop= MM_ConnSMNews_STRING function getComCount(art)
'this gets the number of comments for an article ConnString = dbop set MyConn= Server.CreateObject("ADODB.Connection") MyConn.Open ConnString strsql = "SELECT ID, Article FROM Comments where Article=" & art Set rsx = Server.CreateObject("ADODB.RecordSet") RSx.CursorType = 2 RSx.open strsql, MyConn, 3, 3 wha=rsx.recordcount getComCount=wha rsx.close set rsx = nothing MyConn.close set MyConn = nothing end function %>
Probably differences in the recordcount property of the recordset. Recordcount fails under some circumstances, you may want to check your MySql ODBC documentation and see how recordcount is implemented.
Also, you set your cursor type to Dynamic, but then in your open statement you change it to a static cursor. One of those choices should probably be removed, although as your code stands the recordset should open with a static cursor.
You can use Select Count(*) as RecordCount from table as an alternate method of getting the recordcount.