Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL insert statement and ADO

Status
Not open for further replies.

john829

Programmer
Sep 14, 1999
10
US
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?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top