A Function to Replace Apostrophes
When an apostrophe ( ' ) is inserted into an insert string errors will occur. The following will cause errors:

LastName = "O'Neal"
Conn.Execute "INSERT (LastName) VALUES ('" & LastName & "')"

The following function will solve this problem:

FUNCTION theFIX( theVariable )
theFIX=Replace(theVariable, "'", "’")
' this replaces an apostrophe ( ' ) with alt 0146 ( ’ ). Note: it looks the same but it is not keyboard apostrophe.
END FUNCTION

Now use the function in the string:

Conn.Execute "INSERT (LastName) VALUES ('" & theFIX(Request("LastName")) & "')"

Solving the Apostrophe Problem
Apostrophes ( ' ) can be very annoying; however, there is a simple fix.... use the Replace function:

SQL="UPDATE table SET field="' & Replace(sText,"'","’")& '" WHERE somecondition = somecondition
This replaces an apostrophe with alt 0146 (the special apostrophe). More Special Characters

from the keyboard   '
from the alt code  ’ 


Or my favorite way

sProduct = Request.Form("Product")
Product = Replace(sProduct,"'","’")

ThreeClicks.com