views:

231

answers:

0

We're in the process of moving a set of websites from one webserver to another. The new server is running MySQL 5.0 whilst the old one was running MySQL 4.0 and we are getting an error on a couple of pages where a sum is being performed. I've had a look at the documentation for the differences between MySQL versions and I can't see any reason why we'd get this error but the code is as follows:

<%  
set MaxProducts = Server.CreateObject("ADODB.Recordset")
MaxProducts.ActiveConnection = ConnString
MaxProducts.Source = "SELECT SUM(OrderDetails.Quantity) AS MaxProduct FROM OrderDetails INNER JOIN Orders ON OrderDetails.OrderID = Orders.OrderID WHERE Orders.Status ='Fulfilled' GROUP BY ProductID ORDER BY MaxProduct DESC LIMIT 1"
MaxProducts.CursorType = 0
MaxProducts.CursorLocation = 2
MaxProducts.LockType = 3
MaxProducts.Open
MaxProducts_numRows = 0
%>

and the error message it now returns is

ADODB.Recordset.1 error '80004005'

SQLState: SL009 Native Error Code: 0 [DataDirect][ODBCCUR lib] No columns were bound prior to calling SQLFetchScroll/SQLExtendedFetch

Any ideas what has changed?

Many thanks