startbar
07-17-2004, 06:16 PM
hi this code:
dim ordervariable, sortorder
ordervariable = "Category" 'default column to sort on
sortorder = "ASC" 'default sortorder
if (len(request.querystring("sortby")) >= 1) then
ordervariable = request.querystring("sortby")
end if
if (len(request.querystring("sortorder")) >= 1) then
sortorder = request.querystring("sortorder")
end if
strSQL = "SELECT Name, Category, County, Town, ID " _
& "FROM NETWORK " _
& "WHERE Status=1 LIKE '%" & Replace(strSearch, "'", "''") & "%' " _
& "OR Name LIKE '%" & Replace(strSearch, "'", "''") & "%' " _
& "OR Category LIKE '%" & Replace(strSearch, "'", "''") & "%' " _
& "ORDER BY & ordervariable & " " & sortorder " _
gives me this error
Microsoft VBScript compilation error '800a0401'
Expected end of statement
/business/network.asp, line 137
& "ORDER BY & ordervariable & " " & sortorder " _
--------------------------------^
any ideas?
thanks
dim ordervariable, sortorder
ordervariable = "Category" 'default column to sort on
sortorder = "ASC" 'default sortorder
if (len(request.querystring("sortby")) >= 1) then
ordervariable = request.querystring("sortby")
end if
if (len(request.querystring("sortorder")) >= 1) then
sortorder = request.querystring("sortorder")
end if
strSQL = "SELECT Name, Category, County, Town, ID " _
& "FROM NETWORK " _
& "WHERE Status=1 LIKE '%" & Replace(strSearch, "'", "''") & "%' " _
& "OR Name LIKE '%" & Replace(strSearch, "'", "''") & "%' " _
& "OR Category LIKE '%" & Replace(strSearch, "'", "''") & "%' " _
& "ORDER BY & ordervariable & " " & sortorder " _
gives me this error
Microsoft VBScript compilation error '800a0401'
Expected end of statement
/business/network.asp, line 137
& "ORDER BY & ordervariable & " " & sortorder " _
--------------------------------^
any ideas?
thanks