Hi.
I need to populate a DB field in a specific table that will be picked up by a third party system and be used to publish to a web page. The field is called "Full description" and is format Long Text / Plain Text. I cant change these.
I need to add the following string which consists of description and then a html formatted statement showing when it will arrive. An example is:
Grand Canal by Kate Spain for Moda. This bright, colourful collection will send you on a marvellous gondola ride through Venice, Italy. !!<<font color='#82558c' size='4'><BR><BR><B> Coming soon in September </size></font></B>>!!
The field is showing correctly in my form (as per example above) in field Me.SectionPageDesc
Code:
SectionPageDescString = Me.SectionPageDesc
' Save Data for Main Product
strUpdate = "UPDATE [Catalog section]" & _
"SET [Catalog section].sSectionDescription = '" & SectionDescString & "'" & _
" WHERE [Catalog section].nSectionID = " & Val(Me.sectionID) & ";"
db.Execute strUpdate, dbFailOnError
Unfortunately this DB update fails. I guess because it gets confused with my single quotes.
If i take out the HTML and update with only:
Grand Canal by Kate Spain for Moda. This bright, colourful collection will send you on a marvellous gondola ride through Venice, Italy.
The DB Update succeeds.
I tried to
Code:
SectionPageDescString = Trim(Replace(Me.SectionPageDesc, "'", "''"))
to help with the single quotes. The update succeeds but the resulting field in the db seems to get 2 single quotes ('') so the HTML does not display correctly on the webpage.
Please could some advise me how to get the field correctly formatted (as per 1st quote) so it apears exactly like that in the DB field?
Many thanks
tony