Hi Gregory,

I think you need to replace the ' (apostrophe) character with a '' (double
apostrophe) before you insert the string into your db
and it should work fine.

Jon

-----Original Message-----
From: Gregory Price [mailto:[EMAIL PROTECTED]]
Sent: 20 August 2001 16:26
To: [EMAIL PROTECTED]
Subject: SQL Server Memo insert


Hello, I am running Jrun and have run into a problem submitting a long
string.
The long string a user submits will likely be in French,
which means a lot of single and double quotes.  I am
now able to submit this field under normal circumstance, but my code is
choking on these characters...  I bet you guys can nail this one pretty
quick...  I must need a function when I set that large string as a
variable... Your help is very much appreciated.  code is below:

<%@ taglib uri="jruntags" prefix="jrun" %>

<% String news_ID= request.getParameter("news_ID"); %>
<% String newsletter_ID= request.getParameter("newsletter_ID"); %>
<% String heading= request.getParameter("heading"); %>
<% String entry= request.getParameter("entry"); %>
<% String enteredby=request.getParameter("enteredby"); %>
<% String newslettermonth= request.getParameter("newslettermonth"); %>
<% String newsletteryear= request.getParameter("newsletteryear");
 String sqlQuery = "INSERT INTO news (newsletter_ID,  heading, entry,
enteredby)   VALUES ("
 +newsletter_ID + ", '"
 +heading+ "', '"
 +entry+"', '"
 +enteredby+"')"; %>



<%--INSERT NEWSITEM--%>
   <jrun:sql datasrc="afdallas" id="allnews">
    <%=sqlQuery%>
   </jrun:sql>



Thanks
Greg Price


----------------------DISCLAIMER-----------------------
The information contained in this e-mail and any files
transmitted with it are confidential and intended for
the addressee only. No other person is authorised to
copy, forward, disclose, distribute or retain this
email in any form. If you have received this e-mail in
error please notify the originator or send an e-mail to
[EMAIL PROTECTED] This e-mail and any
associated attachments have been scanned for viruses
prior to dispatch, however Emap Performance and its
subsidiary companies accept no liability for any losses
resulting from infected e-mail transmissions.

Please note any views expressed may be those of the
originator and do not necessarily reflect those of this
organisation.
--------------------------------------------------------
Title: Message
Hi Gregory,
 
I think you need to replace the ' (apostrophe) character with a '' (double apostrophe) before you insert the string into your db
and it should work fine.
 
Jon
-----Original Message-----
From: Gregory Price [mailto:[EMAIL PROTECTED]]
Sent: 20 August 2001 16:26
To: [EMAIL PROTECTED]
Subject: SQL Server Memo insert

Hello, I am running Jrun and have run into a problem submitting a long string.
The long string a user submits will likely be in French,
which means a lot of single and double quotes.  I am
now able to submit this field under normal circumstance, but my code is
choking on these characters...  I bet you guys can nail this one pretty
quick...  I must need a function when I set that large string as a
variable... Your help is very much appreciated.  code is below:

<%@ taglib uri="jruntags" prefix="jrun" %>

<% String news_ID= request.getParameter("news_ID"); %>
<% String newsletter_ID= request.getParameter("newsletter_ID"); %>
<% String heading= request.getParameter("heading"); %>
<% String entry= request.getParameter("entry"); %>
<% String enteredby=request.getParameter("enteredby"); %>
<% String newslettermonth= request.getParameter("newslettermonth"); %>
<% String newsletteryear= request.getParameter("newsletteryear");
 String sqlQuery = "INSERT INTO news (newsletter_ID,  heading, entry,
enteredby)   VALUES ("
 +newsletter_ID + ", '"
 +heading+ "', '"
 +entry+"', '"
 +enteredby+"')"; %>



<%--INSERT NEWSITEM--%>
   <jrun:sql datasrc="afdallas" id="allnews">
    <%=sqlQuery%>
   </jrun:sql>
 
 
Thanks
Greg Price

Reply via email to