View Full Version : query working from access but not asp

03-20-2006, 10:10 AM
I have the following query that if I copy and paste to access then it runs.
In asp it gives an error:
Microsoft JET Database Engine error '80040e14'

Syntax error in ORDER BY clause.

/admin.asp, line 4742

if i remove the order by then it works.

what is wrong with the order by statement?

select [NameOfProgram],[LastName],[FirstName],[Age],[City] from participants where nameofprogram like 'abc' order by lastname,firstname

03-20-2006, 10:23 AM
case sensitive?

03-20-2006, 10:28 AM
no i tried that and it didn't make a differnce -- any field name that I add to the order by causes the same error.

03-20-2006, 10:42 AM
have you tried using the [ and ] around the fieldnames in the order by clause?

03-20-2006, 10:51 AM
yes still doesn't work - it's very strange...

03-20-2006, 11:00 AM
does it work when you drop teh where clause?

03-20-2006, 06:19 PM
Can you post your actual ASP coding