Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Senior Coder
    Join Date
    May 2004
    Posts
    1,441
    Thanks
    15
    Thanked 0 Times in 0 Posts

    query working from access but not asp

    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

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    Zwolle, The Netherlands
    Posts
    1,120
    Thanks
    2
    Thanked 31 Times in 31 Posts
    case sensitive?
    I am the luckiest man in the world

  • #3
    Senior Coder
    Join Date
    May 2004
    Posts
    1,441
    Thanks
    15
    Thanked 0 Times in 0 Posts
    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.

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    Zwolle, The Netherlands
    Posts
    1,120
    Thanks
    2
    Thanked 31 Times in 31 Posts
    have you tried using the [ and ] around the fieldnames in the order by clause?
    I am the luckiest man in the world

  • #5
    Senior Coder
    Join Date
    May 2004
    Posts
    1,441
    Thanks
    15
    Thanked 0 Times in 0 Posts
    yes still doesn't work - it's very strange...

  • #6
    Senior Coder
    Join Date
    Jun 2002
    Location
    Zwolle, The Netherlands
    Posts
    1,120
    Thanks
    2
    Thanked 31 Times in 31 Posts
    does it work when you drop teh where clause?
    I am the luckiest man in the world

  • #7
    Senior Coder
    Join Date
    Nov 2002
    Location
    North-East, UK
    Posts
    1,265
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Can you post your actual ASP coding


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •