mcs26
asked on
SQL Query with apostrophe
Hi,
I have an access database where I insert some records into my table. The records are file names from certain folders. The query works fine (please see the code below).
The only issue is when a file name has an apostrophe in it. For example a file called "Word Documents" would work fine, however a file called "Word Document's" would not work becuase of the apostrophe.
Any help would be great.
Thanks,
M
I have an access database where I insert some records into my table. The records are file names from certain folders. The query works fine (please see the code below).
The only issue is when a file name has an apostrophe in it. For example a file called "Word Documents" would work fine, however a file called "Word Document's" would not work becuase of the apostrophe.
Any help would be great.
Thanks,
M
strSQL = "INSERT INTO tblCompanyFiles ([Ticker], [Folder], [FileName], [DocType]) " & _
"VALUES ('" & Ticker & "','" & objFolder.Name & "','" & objFile.Name & "','" & DocType & "');"
DoCmd.RunSQL strSQL
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.