Hi There,
I tried the statement that you posted but there is still some errors
with it, so I changed it so that the string field (OptionValue) used
the syntax you posted, I also wrote the SQL to the screen, the
statement still truncates the string after the quotation mark. I have
tried the replace statement and just about everything else I can
think of.
Any other ideas?
Sean - thanks in advance for ypur answer
!-- string I am trying to insert
It's a girl
!-- statement
INSERT INTO product_options
(ProductID,OptionValue,IsColour,OptionIDValue) Values(24,'It','-1',1)
!-- code
for i = 1 to Request("chkOptions").count
strOption = Request.form("chkOptions")
chkOptionsID = Request("chkOptionsID")(i)
SQLstr = "INSERT INTO product_options
(ProductID,OptionValue,IsColour,OptionIDValue) Values(" & ProductID
& ","+"'" + strOption + "'"+",'" & IsColour & "'," & chkOptionsID
& ")"
db_conn.Execute (SQLstr)
response.Write SQLstr
next
--- In [EMAIL PROTECTED], rajini kanth
<[EMAIL PROTECTED]> wrote:
>
> try this for statment
>
> 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
> rgds
> s rajinikanth mca
> 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 SponsorADVERTISEMENT
>
>
> ---------------------------------
> 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 the Yahoo! Terms of
Service.
>
>
> Yahoo! India Careers: Over 50,000 jobsonline.
>
> [Non-text portions of this message have been removed]
------------------------ 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/