Query Error

Discussion in 'ASP General' started by Savas Ates, Jul 10, 2004.

  1. Savas Ates

    Savas Ates Guest

    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?
    Savas Ates, Jul 10, 2004
    #1
    1. Advertising

  2. Savas Ates wrote:
    > 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

    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
    Bob Barrows [MVP], Jul 10, 2004
    #2
    1. Advertising

  3. Savas Ates wrote:
    > 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 ...

    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
    Bob Barrows [MVP], Jul 10, 2004
    #3
  4. Savas Ates

    Mark Guest

    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."

    "Savas Ates" <> wrote in message
    news:%23KS%...
    > 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?
    >
    >
    Mark, Jul 10, 2004
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Learner
    Replies:
    1
    Views:
    968
    Marina Levit [MVP]
    Jan 30, 2006
  2. Anonymous
    Replies:
    0
    Views:
    1,427
    Anonymous
    Oct 13, 2005
  3. David Gordon

    xpath query query

    David Gordon, May 18, 2005, in forum: XML
    Replies:
    2
    Views:
    770
    David Gordon
    May 18, 2005
  4. Eric Nelson
    Replies:
    5
    Views:
    1,497
    Alexey Smirnov
    Feb 4, 2009
  5. Jon F.

    CAML Query: Multiple Query Fields Issue

    Jon F., May 12, 2004, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    739
    Jon F.
    May 12, 2004
Loading...

Share This Page