|
 |
asp_databases thread: error '80040e14' The text cannot be used in an ORDER BY clause.
Message #1 by "Nadia" <mir_rizwan@h...> on Tue, 9 Jul 2002 16:17:28
|
|
I get the above error message when I put the following SQL statement.
It worked when I was using Access but now I'm using SQL 2000
The table names are right and it works if I take out the ORDER BY part out.
Can anyone help me????
searchSQL = "SELECT * FROM Tasphone2 WHERE " & field & " LIKE '%"& query
& "%' ORDER BY firstName ; "
Message #2 by "Drew, Ron" <RDrew@B...> on Wed, 10 Jul 2002 10:35:33 -0400
|
|
Do a response.write on firstName and on searchSQL
See what is being passed and what the either sql statement looks like
before running the command.
compare what is being passed to the column name on the table
If you still have a problem, post the results of the response.write
statements so we can have a look
-----Original Message-----
From: Nadia [mailto:mir_rizwan@h...]
Sent: Wednesday, July 10, 2002 10:23 AM
To: ASP Databases
Subject: [asp_databases] Re: error '80040e14' The text cannot be used in
an ORDER BY clause.
Thank you for your response
firstName is a colunm in my table. The 'field' allows the users to
choose
the column they want search and 'query' is the search they enter.
The 'field' and 'query' work fine as I have printed these on my page and
they call the right data and the problem only occurs when I add the
'ORDER
BY fieldName' at the end of my SQL statement.
Do you have any more ideas????
> Your problem is firstName. The Order by wants a column not a
> variable.
If firstName is a column then..also make sure you put a check in to make
sure "field" and "query" (pick different names as field/query could be a
reserved words) are not null and entries have been made.=3D20
searchSQL =3D3D "SELECT * FROM Tasphone2 WHERE " & field & " LIKE '%"&
query=3D20 & "%' ORDER BY firstName"; "
Message #3 by "Nadia" <mir_rizwan@h...> on Wed, 10 Jul 2002 14:22:32
|
|
Thank you for your response
firstName is a colunm in my table. The 'field' allows the users to choose
the column they want search and 'query' is the search they enter.
The 'field' and 'query' work fine as I have printed these on my page and
they call the right data and the problem only occurs when I add the 'ORDER
BY fieldName' at the end of my SQL statement.
Do you have any more ideas????
> Your problem is firstName. The Order by wants a column not a variable.
If firstName is a column then..also make sure you put a check in to make
sure "field" and "query" (pick different names as field/query could be a
reserved words) are not null and entries have been made.
searchSQL =3D "SELECT * FROM Tasphone2 WHERE " & field & " LIKE '%"&
query
& "%' ORDER BY firstName"; "
Message #4 by "Drew, Ron" <RDrew@B...> on Wed, 10 Jul 2002 07:54:01 -0400
|
|
Your problem is firstName. The Order by wants a column not a variable.
If firstName is a column then..also make sure you put a check in to make
sure "field" and "query" (pick different names as field/query could be a
reserved words) are not null and entries have been made.
searchSQL =3D "SELECT * FROM Tasphone2 WHERE " & field & " LIKE '%"&
query
& "%' ORDER BY firstName"; "
-----Original Message-----
From: Nadia [mailto:mir_rizwan@h...]
Sent: Wednesday, July 10, 2002 5:16 AM
To: ASP Databases
Subject: [asp_databases] Re: error '80040e14' The text cannot be used in
an ORDER BY clause.
I'm guessing its an SQL problem, the sql statement is written below
searchSQL =3D "SELECT * FROM Tasphone2 WHERE " & field & " LIKE '%"&
query
& "%' ORDER BY " & firstName & "; "
> Hi nadia,
plz post the full code ...
Thanks,
Vinnie
----- Original Message -----
From: "Nadia" <mir_rizwan@h...>
To: "ASP Databases" <asp_databases@p...>
Sent: Tuesday, July 09, 2002 4:17 PM
Subject: [asp_databases] error '80040e14' The text cannot be used in an
ORDER BY clause.
> I get the above error message when I put the following SQL statement.
> It worked when I was using Access but now I'm using SQL 2000
>
> The table names are right and it works if I take out the ORDER BY part
out.
>
> Can anyone help me????
>
> searchSQL =3D "SELECT * FROM Tasphone2 WHERE " & field & " LIKE '%"&
> query & "%' ORDER BY firstName ; "
> ---
> Change your mail options at http://p2p.wrox.com/manager.asp or to
> unsubscribe send a blank email to
>
Message #5 by "Nadia" <mir_rizwan@h...> on Wed, 10 Jul 2002 09:15:53
|
|
I'm guessing its an SQL problem, the sql statement is written below
searchSQL = "SELECT * FROM Tasphone2 WHERE " & field & " LIKE '%"& query
& "%' ORDER BY " & firstName & "; "
> Hi nadia,
plz post the full code ...
Thanks,
Vinnie
----- Original Message -----
From: "Nadia" <mir_rizwan@h...>
To: "ASP Databases" <asp_databases@p...>
Sent: Tuesday, July 09, 2002 4:17 PM
Subject: [asp_databases] error '80040e14' The text cannot be used in an
ORDER BY clause.
> I get the above error message when I put the following SQL statement.
> It worked when I was using Access but now I'm using SQL 2000
>
> The table names are right and it works if I take out the ORDER BY part
out.
>
> Can anyone help me????
>
> searchSQL = "SELECT * FROM Tasphone2 WHERE " & field & " LIKE '%"& query
> & "%' ORDER BY firstName ; "
>
Message #6 by "Vincent Vandermeeren \(mailinglists Only\)" <vinnie@j...> on Tue, 9 Jul 2002 18:46:44 +0200
|
|
Hi nadia,
plz post the full code ...
Thanks,
Vinnie
----- Original Message -----
From: "Nadia" <mir_rizwan@h...>
To: "ASP Databases" <asp_databases@p...>
Sent: Tuesday, July 09, 2002 4:17 PM
Subject: [asp_databases] error '80040e14' The text cannot be used in an
ORDER BY clause.
> I get the above error message when I put the following SQL statement.
> It worked when I was using Access but now I'm using SQL 2000
>
> The table names are right and it works if I take out the ORDER BY part
out.
>
> Can anyone help me????
>
> searchSQL = "SELECT * FROM Tasphone2 WHERE " & field & " LIKE '%"& query
> & "%' ORDER BY firstName ; "
>
|
|
 |