Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2002
    Posts
    4

    Question Unanswered: Insert Into problem - quotes in field I am inserting...

    Help, I am trying to insert from a text file into my db and the program breaks when the field I am inserting contains a ' ie [O'brian] or [Harvey's].

    Here is the initial code. I tried to use chr(34) to no avail (perhaps I do not know how to build it in). Any and all help is much appreciated.

    Trevor



    db.Execute "INSERT INTO tblAdhocsMain VALUES ('" & strFullPath & "', '" & dteDate & "', '" & strName & "', '" & strAdd & "', '" & strAdd2 & "', '" & strCity & "', '" & strState & "', '" & strZip & "', '" & strOther & "', '" & strOther2 & "', '" & strAcct & "')" 'insert into table

  2. #2
    Join Date
    Oct 2002
    Location
    Rochester, NY
    Posts
    84
    Can I ask you a simple question in return? Why are you using single quotes in addition to double quotes to create your execution string? (i.e "INSERT INTO tblAdhocsMain VALUES ('" & strFullPath ...

    Are you using ODBC to execute something in another (non-Access) database?
    Regards,
    Terry

Posting Permissions

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