Click to See Complete Forum and Search --> : order by desc


benbramz
09-16-2005, 11:38 AM
hi!

can anybody please tell me what i have done wrong with this please? im getting an error

Classifieds.Open "SELECT * FROM thread where forumID=" & request("f") & "order by id desc", Connect, 2, 2


Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'forumID=1order by id desc'.

/rotn/showforum.asp, line 20



thanks a lot

lmf232s
09-16-2005, 01:21 PM
if you do a response.write SQL youll see the print out like you do in the error.
This
where forumID=" & request("f") & "order by id desc
Results in this
where forumID=1order by id desc

Notice that there is no space between 1 and order, so you get a syntax error
add a space after the ", like this

where forumID=" & request("f") & " order by id desc