Forums
This topic is locked
Recordsets not working after update 8.0.2.
17 Jun 2006 05:52:07 Wim Conix posted:
Hello,My recordsets with filters are not working correct anymore after I updated DW.
Parameters seem to be giving errors now.
Is there something that must be handcode changed after the update ?
Example recordset giving errors :
<%
Dim Recordset1__MMColParam
Recordset1__MMColParam = "xxyyzz"
If (Request.Querystring("keyword" <> "" Then
Recordset1__MMColParam = Request.Querystring("keyword"
End If
%>
<%
Dim Recordset1
Dim Recordset1_cmd
Dim Recordset1_numRows
Set Recordset1_cmd = Server.CreateObject ("ADODB.Command"
Recordset1_cmd.ActiveConnection = MM_conn_photodat_sql_STRING
Recordset1_cmd.CommandText = "SELECT Images.ID AS ImgID, Galleries.ID AS GalleryID, Galleries.Gallery, Images.Keywords, Users.Author, Users.Username, Images.Filename, Images.Caption, Users.ID AS UsrID, SUBSTRING(Images.Filename,17+LEN(Images.Author)+LEN(Images.Author),LEN(SUBSTRING(Images.Filename,17+LEN(Images.Author)+LEN(Images.Author),PATINDEX('%.jpg%', Images.Filename)))-4) As Filename_short, Users.Email, Images.Hit, Users.Subdomain_URL, Users.Active FROM (Images INNER JOIN Users ON Images.Author = Users.ID) INNER JOIN Galleries ON Images.Gallery = Galleries.ID WHERE (Keywords LIKE ? OR Images.Filename LIKE %MMColParam% OR Caption LIKE %MMColParam% OR Galleries.Gallery LIKE %MMColParam% OR Users.Author LIKE '%MMColParam%') AND Images.Filename IS NOT NULL AND Galleries.Private = 0 AND Users.Active = 1 ORDER BY Images.Keywords, Images.Caption, Images.ID DESC"
Recordset1_cmd.Prepared = true
Recordset1_cmd.Parameters.Append Recordset1_cmd.CreateParameter("param1", 200, 1, 255, "%" + Recordset1__MMColParam + "%" ' adVarChar
Set Recordset1 = Recordset1_cmd.Execute
Recordset1_numRows = 0
%>
This gives incorrect syntax error on MMColParam.
In the test from DW, as well as on the live site.
I'm sure this page worked fine before 8.0.2. update.
What's wrong ?
Thanks for any help,
Wim
Wim Conix
www.image-belle.com