Function FixSingleQuotes(String)
   String = Replace(String, "'", "''")
   FixSingleQuotes = String
End Function
--- In [EMAIL PROTECTED], "sean12302000" 
<[EMAIL PROTECTED]> wrote:
> HI There,
> 
> I have an access db to which I am trying to insert multiple 
strings. 
> The page has a list of checkboxes and every row has a hidden field 
> with the productid on it, when I have one word values to insert 
they 
> are handled without a problem, but when I have multiword (I have a 
> dream) or with single quotes (It's a boy) the program falls over. 
> 
> Can someone tell me how I can get around this issue, as I have 
tried 
> the string replace method as well as many other things.
> 
> Thanks in advance for your answer     
> 
> !-- code
> 
> <input type="hidden" name="chkOptionsID" value='41'>
> <tr><td width="70%">Its a boy</td><td>$ 8.00</td><td><input 
> type="checkbox" name="chkOptions" value='It's a boy'><td></tr>
> <input type="hidden" name="chkOptionsID" value='42'>
> <tr><td width="70%">Its a girl</td><td>$ 8.00</td><td><input 
> type="checkbox" name="chkOptions" value='It's a girl'><td></tr>
> 
> for i = 1 to Request("chkOptions").count
>               strOption     = Request.form("chkOptions")
>                       
>               chkOptionsID    = Request("chkOptionsID")(i)
>               db_conn.Execute "INSERT INTO product_options 
> (ProductID,OptionValue,IsColour,OptionIDValue) Values(" & ProductID 
> & ",'" & strOption & "','" & IsColour & "'," & chkOptionsID & ")"
>       
>       next



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Yahoo! Domains - Claim yours for only $14.70
http://us.click.yahoo.com/Z1wmxD/DREIAA/yQLSAA/saFolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspClassicAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to