Query Error

S

Savas Ates

query="select * from mytable where id="&xx
id is a numerical field..

if a user choose xx char or a string my query gives an error in asp...
i tried
if err.number <>0 then response.redirect "xx.asp"
but problem is still continueing...

how can i solve this problem?
 
B

Bob Barrows [MVP]

Savas said:
query="select * from mytable where id="&xx
id is a numerical field..

if a user choose xx char or a string my query gives an error in asp...
i tried
if err.number <>0 then response.redirect "xx.asp"
but problem is still continueing...

how can i solve this problem?

Show the code. Is xx.asp the same page?

Bob Barrows
 
B

Bob Barrows [MVP]

Savas said:
query="select * from mytable where id="&xx
id is a numerical field..

if a user choose xx char or a string my query gives an error in asp...
i tried
if err.number <>0 then response.redirect "xx.asp"
but problem is still continueing...

how can i solve this problem?


Assuming your code has an "On Error Resume Next" statement ...
 
M

Mark

Before executing your query in the database, check that the user input is
actually a number..

If Not IsNumeric(xx) Then Response.Write "Invalid entry. Entry must be a
number."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top