Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_database_setup thread: Please Help!!!


Message #1 by "Isaac Sogunro" <isogunro@h...> on Thu, 10 May 2001 13:24:45 -0400
I get the error below when I enter data into a form and hit the submit button.



Microsoft JET Database Engine error '80040e14' 



Syntax error (missing operator) in query expression ''I enjoy this and this and that and that and this and this. It's great and
(<- I think the error is becuase of this single quote)

wonderful.','Sharon','Starks','Sstarksaol.com','703-234-768')'. 



/Conf_Registration/comments/ProcComments.asp, line 28 



mySQL = "INSERT INTO "

    mySQL = mySQL + "tblThoughts(Comments, FName, LName, Email, Phone)";

    mySQL = mySQL + "VALUES ('" + Request.Form("comments") + "','";

    mySQL = mySQL + Request.Form("FName") + "','";

    mySQL = mySQL + Request.Form("LName") + "','";

    mySQL = mySQL + Request.Form("email") + "','";

    mySQL = mySQL + Request.Form("phone") + "')";      

 

 conn.Execute(mySQL);



I think I get the error because of the single quote that's part of my sentence that's passed to the ASP page.  What can I do to fix
it.  Thank you in advance for your help.





-Isaac-



Message #2 by "Ken Schaefer" <ken@a...> on Fri, 11 May 2001 14:48:40 +1000
Replace the single ' with two single '



http://www.adopenstatic.com/resources/code/fncReplaceSingleQuotes.asp



and you should be doing some kind of validation on the user input:



http://www.adopenstatic.com/resources/code/UIValidation.asp





Cheers

Ken



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

----- Original Message -----

From: "Isaac Sogunro" <isogunro@h...>

To: "ASP Database Setup" <asp_database_setup@p...>

Sent: Friday, May 11, 2001 3:24 AM

Subject: [asp_database_setup] Please Help!!!





: I get the error below when I enter data into a form and hit the submit

button.

:

: Microsoft JET Database Engine error '80040e14'

:

: Syntax error (missing operator) in query expression ''I enjoy this and

this and that and that and this and this. It's great and (<- I think the

error is becuase of this single quote)

: wonderful.','Sharon','Starks','Sstarksaol.com','703-234-768')'.

:

: /Conf_Registration/comments/ProcComments.asp, line 28

:

: mySQL = "INSERT INTO "

:     mySQL = mySQL + "tblThoughts(Comments, FName, LName, Email, Phone)";

:     mySQL = mySQL + "VALUES ('" + Request.Form("comments") + "','";

:     mySQL = mySQL + Request.Form("FName") + "','";

:     mySQL = mySQL + Request.Form("LName") + "','";

:     mySQL = mySQL + Request.Form("email") + "','";

:     mySQL = mySQL + Request.Form("phone") + "')";

:

:  conn.Execute(mySQL);

:

: I think I get the error because of the single quote that's part of my

sentence that's passed to the ASP page.  What can I do to fix it.  Thank you

in advance for your help.

:

:

: -Isaac-






  Return to Index