I have an app that searches my drive for certain files, and stores their info in an Access 2000 database. My search is fine, but the insert statement is giving me problems. I am using ADO (import method) and have declared a connectionptr, and have connected to the DB, I am then using the CommandText field, and setting it to the SQL statement. This is the SQL I'm using:
INSERT INTO Files (filename,filetype....) VALUES ("val1", "val2",.....)
I then call the Excute() method to run the CommandText. It works until the filename has certain characters in it. For example, the & and commas will cause it to crash. What can I do to keep this from happening? Do I need to escape these characters, or change the statement?
INSERT INTO Files (filename,filetype....) VALUES ("val1", "val2",.....)
I then call the Excute() method to run the CommandText. It works until the filename has certain characters in it. For example, the & and commas will cause it to crash. What can I do to keep this from happening? Do I need to escape these characters, or change the statement?