aqui hay algo para transformar el texto que queremos insertar por medio de sql y que no nos mande error de comillas, apostrofes, etc.
hice dos funciones: una que convierte el texto y otra que lo codifica...
solo converti los caracteres "extraños"
para ver una lista completa de códigos html en hex, ascii, etc. vallan a
http://ascii.cl/es/codigos-html.htm
Código:
'Codifica el Texto
Function EncodeText(strTexto)
if strTexto <> "" or isnull(strTexto) = false then
for I = 33 to 47
if I <> 35 and I <> 38 then
strTexto = replace(strTexto, chr(I), "&#" & I & ";")
end if
next
for I = 58 to 63
if I <> 59 then
strTexto = replace(strTexto, chr(I), "&#" & I & ";")
end if
next
for I = 91 to 96
strTexto = replace(strTexto, chr(I), "&#" & I & ";")
next
for I = 123 to 126
strTexto = replace(strTexto, chr(I), "&#" & I & ";")
next
for I = 161 to 255
strTexto = replace(strTexto, chr(I), "&#" & I & ";")
next
else
strTexto = ""
end if
EncodeText = strTexto
End Function
'Decodifica el Texto
Function DecodeText(strTexto)
if strTexto <> "" or isnull(strTexto) = false then
for I = 33 to 47
if I <> 35 and I <> 38 then
strTexto = replace(strTexto, "&#" & I & ";", chr(I))
end if
next
for I = 58 to 63
if I <> 59 then
strTexto = replace(strTexto, "&#" & I & ";", chr(I))
end if
next
for I = 91 to 96
strTexto = replace(strTexto, "&#" & I & ";", chr(I))
next
for I = 123 to 126
strTexto = replace(strTexto, "&#" & I & ";", chr(I))
next
for I = 161 to 255
strTexto = replace(strTexto, "&#" & I & ";", chr(I))
next
else
strTexto = ""
end if
DecodeText = strTexto
End Function