a newbie, questions about using asp variables to insert value into numeric column(bigint,int,money)

Discussion in 'ASP General' started by bidepan@gmail.com, Nov 16, 2006.

  1. Guest

    I have a sql server database and want to access data using asp form.
    But i always get trouble with inserting/updating data in numeric type
    columns.Troubles described as belows.
    I used one textbox in asp form to accept int type input (like age). And
    i defined a variable in asp code to fetch submitted value of a textbox.
    Dim variable1
    variable1= request.form("textbox1")
    By using Connection_Name.execute "Insert into tablename(column1) values
    ("&variable1&")"
    i wanted to insert values into database.
    I got error message like "there are syntax error near..." if the
    textbox was blank when the form was submitted
    I try to print the sql command by using response.write"Insert into
    tablename(column1) values ("&variable1&")"
    i get Insert into tablename(column1) values
    nothing was there, or just blank between the comma
    I think the problem is that i can not insert a Null into a int type
    column. But i don't know how to resolve it. Anyone can help? Thanks a
    lot
    , Nov 16, 2006
    #1
    1. Advertising

  2. Mike Brind Guest

    <> wrote in message
    news:...
    >I have a sql server database and want to access data using asp form.
    > But i always get trouble with inserting/updating data in numeric type
    > columns.Troubles described as belows.
    > I used one textbox in asp form to accept int type input (like age). And
    > i defined a variable in asp code to fetch submitted value of a textbox.
    > Dim variable1
    > variable1= request.form("textbox1")
    > By using Connection_Name.execute "Insert into tablename(column1) values
    > ("&variable1&")"
    > i wanted to insert values into database.
    > I got error message like "there are syntax error near..." if the
    > textbox was blank when the form was submitted
    > I try to print the sql command by using response.write"Insert into
    > tablename(column1) values ("&variable1&")"
    > i get Insert into tablename(column1) values
    > nothing was there, or just blank between the comma
    > I think the problem is that i can not insert a Null into a int type
    > column. But i don't know how to resolve it. Anyone can help? Thanks a
    > lot
    >


    http://www.aspfaq.com/etiquette.asp?id=5003

    Answered in .db

    --
    Mike Brind
    Mike Brind, Nov 16, 2006
    #2
    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. Schnoffos
    Replies:
    2
    Views:
    1,194
    Martien Verbruggen
    Jun 27, 2003
  2. Hal Styli
    Replies:
    14
    Views:
    1,608
    Old Wolf
    Jan 20, 2004
  3. Replies:
    5
    Views:
    909
    X-Centric
    Jun 30, 2005
  4. Replies:
    0
    Views:
    808
  5. jobs

    int to numeric numeric(18,2) ?

    jobs, Jul 21, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    932
    =?ISO-8859-1?Q?G=F6ran_Andersson?=
    Jul 22, 2007
Loading...

Share This Page