Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Double Quote Marks in Access DB


Message #1 by "info" <info@p...> on Fri, 25 May 2001 11:43:33 -0400
Hello,



I'm having a problem entering in double quote marks from a textarea

field into a memo field in an Access database.



I've researched all the asp archives at p2p.wrox.com and all I can

find is a replace function for single quotes.  

replace(strVar, "'", "''")



Single Quotes are entering fine.  My problem is with text like:

She said, "there could have been..."

Everything up to the double quote gets entered.



Here is the code:



'fill the variable from the textarea

varEventDesc = Request.Form("EventDesc")



'-------------

'Enter Data into the database.

'-------------



Const adOpenStatic = 3

Const adCmdTable = &H0002

Const adLockOptimistic = 3





'make a recordset

Dim objAddRec

Set objAddRec = Server.CreateObject("ADODB.Recordset")





'open the table to update

objAddRec.Open "Events", Application("ConnString"), adOpenStatic,

adLockOptimistic, adCmdTable



'create a new record

objAddRec.AddNew



'set the fields equal to the variables

objAddRec("EventDesc") = varEventDesc



'update the database with the new records

objAddRec.Update



'close the database

objAddRec.Close

Set objAddRec = Nothing





Mitch




  Return to Index