B
bidepan
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
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