Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New Coder
    Join Date
    Dec 2003
    Location
    PimP City USA
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    problem inserting info into DB

    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.

    thanks!!

  • #2
    New Coder
    Join Date
    Dec 2003
    Location
    PimP City USA
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ok, hmm, now it all the sudden decides to work? lol...

  • #3
    New Coder
    Join Date
    Dec 2003
    Location
    PimP City USA
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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?

    thanks!

  • #4
    Senior Coder
    Join Date
    Dec 2002
    Location
    Arlington, Texas USA
    Posts
    1,065
    Thanks
    4
    Thanked 8 Times in 8 Posts
    use the replace function to cure this like so

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

  • #5
    New Coder
    Join Date
    Dec 2003
    Location
    PimP City USA
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thank you miranda,

    where in the code do i put it at?

  • #6
    Senior Coder
    Join Date
    Dec 2002
    Location
    Arlington, Texas USA
    Posts
    1,065
    Thanks
    4
    Thanked 8 Times in 8 Posts
    like this

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


    then do your SQL statement.

  • #7
    New to the CF scene
    Join Date
    Dec 2005
    Location
    philippines
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy still doesnt work

    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.
    Last edited by munggoy; 12-12-2005 at 01:34 AM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •