apostrophe in err.description

R

rocco

Hello,
I have an application that manages many data imported from an external
database.
I have built an error handler that will collect all the errors that may
arise during importing data and records them in a table.
It crashs on an error description that has apostrophes.

To do this i'm using:
_____________
dim errore as string
errore = "#" & Time() & "#,'" & status & "','ERR','" & Err.Description &
"'," & Err.Number
DoCmd.RunSQL ("INSERT INTO impreport
(data,operazione,esito,errdescr,errnumb) Values (" & errore & ")")

It comes out with an error msg saying:
syntax error (missing operator) in query expression "Record(s) cannot be
read; no read permission on 'scid_riepilogativa'.".

I have solved the main problem (the read permission), but it may happens
again to the user and i want to have the err.description saved in a table's
field.
I think the problems are the apostrophes used in the err.description.
How can this problem been solved?
Thanks,
Rocco
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top