View Full Version : problem inserting info into DB

12-31-2003, 07:21 PM
Hi everyone!

Im inserting info from a form into my access db. one of the fields is named "Comments". When I type some comments in there, lets say about as long as what im writing now, I get an error. If I type like, 1 small sentence, it inserts. I have the field set to "Memo" in access, so im not sure what the problem is.

Try it, http://www.ocmotorcars.com/ocM/email/email.asp

type or copy a big paragraph into the comments box.


12-31-2003, 07:23 PM
ok, hmm, now it all the sudden decides to work? lol... :confused:

12-31-2003, 07:50 PM
ok, thats fixed, but now i have another question. when im typing something into the comments box, if i use an apostrophe, then i get an error, how can i let it accept apostrophe's?


01-02-2004, 07:13 PM
use the replace function to cure this like so

Replace(myString, "'", "''")

01-02-2004, 11:53 PM
thank you miranda,

where in the code do i put it at?

01-03-2004, 12:37 AM
like this

dim myString
myString = Request.Form("foobar")
myString = Replace(myString, "'", ""'")

then do your SQL statement.

12-12-2005, 02:31 AM
i typed the following:

neww =request.form("newsarea")
Replace (neww,"'", "''")
sql="INSERT INTO headline(news)"
sql= sql & " VALUES ('" & neww & "')"
set rs=conne.Execute(sql)%>

still,, i get this error:

Error Type:
Microsoft VBScript compilation (0x800A0414)
Cannot use parentheses when calling a Sub
/psc/filer.asp, line 14, column 24
Replace (neww,"'", "''")

need some help please.