I'm having an issue getting "and" to work properly in this bit of code.
I believe i've written it down correctly and have tried several
methods, but I keep getting an error.
Set rsDownload = Server.CreateObject("ADODB.RecordSet")
strSQL = "SELECT Download_ID, Download_Preview,
Download_Preview_Movie, Download_Version, D_FreeCommercial,
Download_Name, D_Short, D_Added, Download_Hits, Download_SubCat,
DComments "
strSQL = strSQL
& " FROM " & strDbTable & "Downloads WHERE " &
strDbTable & "Downloads.Download_SubCat = " & scid & "AND" & strDbTable & "Downloads.D_Short & AND"
'If the user has selected all or
any words then build the where clause with the words to be searched
If strSearchMode2 = "2" OR strSearchMode2 = "1" Then
'Call the function to build the query
strSQL = strSQL & BuildSQL
("" & strDbTable & "Downloads.Download_Name", sarySearchWord)
Else
strSQL = strSQL & """" &
strDbTable & "Downloads.Download_Name LIKE '%" &
strSearchKeywords & "%'"
End If
|
Microsoft OLE DB Provider for SQL Server error
'80040e14'
Line 1: Incorrect syntax near
'ANDtblDownloads'.
/c4dportal2/forum/functions/3rdparty/functions_download.asp, line 1026