我有一个关于如何在访问数据库中提交包含撇号的查询的问题。例如,我想搜索标题中包含“女性健康”的记录。当我尝试搜索时,即使有包含该短语的记录,也不会出现任何记录。如果我搜索女性健康,就会出现记录。我怎样才能克服撇号的问题?
我试过搜索以前的问题,其中大多数人说我应该在我的 SQL 查询中使用“”,但我正在使用它,但它仍然不能解决问题。我没有技术背景,谁能给我一些关于如何修复我的查询的建议,以便我可以使用撇号进行搜索?我的查询如下。谢谢!
SELECT [Off-site records].[File Name], [Off-site records].Unit,
[Off-site records].Branch, [Off-site records].Division,
[Off-site records].[Date Sent], [Off-site records].[Archives (Yes/No)],
[Off-site records].[Date range], [Off-site records].[Accession Number],
Off-site records].[Box #], [Off-site records].[File Name],
[Off-site records].ID, [Off-site records].[File Name],
[Off-site records].[File Name]
FROM [Off-site records]
WHERE ((([Off-site records].[File Name]) Like "" & Forms!Search![File name] & "")
And (([Off-site records].Unit) Like "" & Forms!Search!Unit & "")
And (([Off-site records].Branch) Like "" & Forms!Search!Branch & "")
And (([Off-site records].Division) Like "" & Forms!Search!Division & "")
And (([Off-site records].[Date Sent]) Like "" & Forms!Search![Date sent] & "")
And (([Off-site records].[Archives (Yes/No)]) Like "" & Forms!Search!Archives & "")
And (([Off-site records].[Date range]) Like "" & Forms!Search![Date range] & "")
And (([Off-site records].[Accession Number]) Like "" & Forms!Search![Accession number] & "")
And (([Off-site records].[Box #]) Like "" & Forms!Search![Box #] & "")
And (([Off-site records].[File Name]) Like "" & Forms!Search![File name 2] & "")
And (([Off-site records].[File Name]) Like "" & Forms!Search![File name 3] & "")
And (([Off-site records].[File Name]) Like "" & Forms!Search![File name 4] & ""));