Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating SQL tables from text boxes

Status
Not open for further replies.

demchak

IS-IT--Management
Jun 29, 2001
36
US
Hopefully I am just missing something here....

I have a form with multiple choice questions that I use radio buttons for and two free form answers that I use text boxes for. The multiple choice questions work fine but I cant seem to get the info from the text box to take. Im using the same code for the text boxes as I am for the radio buttons but I keep getting the following error on my submit page when I try to add text. Both text boxes have default text so they is text in there for sure.
Thanks guys,
Demchak


==============Error message========================
Database Error: [Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near ','. One or more form fields were empty.
=========================================================

===============Text box code====does not work============
UPDATE [tblRollcall/Evaluation]
SET [Q10]=%%q10%%,[Q11]=%%q11%% WHERE [W-Number]=%%wnumber%% AND [SessionID]=%%session%%;
==========================================================

===============Radio button code===works fine==========
UPDATE [tblRollcall/Evaluation]
SET [Q1]=%%q1%%,[Q2]=%%q2%%,[Q3]=%%q3%%,[Q4]=%%q4%%,[Q5]=%%q5%%,[Q6]=%%q6%%,[Q7]=%%q7%%,[Q8]=%%q8%%,[Q9]=%%q9%% WHERE [W-Number]=%%wnumber%% AND [SessionID]=%%session%%;
=======================================================



 
Hi, a few ideas for deBugging as it looks like your code is fine....(What is here). First are you posting from one page to the other? If you are change to method="get" in the form and then you can debug your querystring with response.write request.quesrystring I have found that this helps narrow things a bit.

Also, It has been a while but I had a problem with freeform text when the user used a Comma or any other special characters that were not URL encoded.

Please post a few more details I am sure we can hammer this out


Bassguy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top