我正在将记录集中的表数据附加到正在工作的表中,直到我得到一个法国客户,他的客户名称中有一个 '。这是代码:
StrSQL3 = " INSERT INTO [ATB] ( SLSMAN, NOCARDEX, email, CLIENT, "
StrSQL3 = StrSQL3 & " NOTRANS, InvoiceDate, Current, [31-60], [61-90], [90+] ) "
StrSQL3 = StrSQL3 & " VALUES ( '" & myRecordSet.Fields(0).Value & "', "
StrSQL3 = StrSQL3 & " '" & myRecordSet.Fields(1).Value & "', "
StrSQL3 = StrSQL3 & " '" & myRecordSet.Fields(2).Value & "', "
StrSQL3 = StrSQL3 & " '" & myRecordSet.Fields(3).Value & "', "
StrSQL3 = StrSQL3 & " '" & myRecordSet.Fields(4).Value & "', "
StrSQL3 = StrSQL3 & " '" & myRecordSet.Fields(5).Value & "', "
StrSQL3 = StrSQL3 & " '" & myRecordSet.Fields(6).Value & "', "
StrSQL3 = StrSQL3 & " '" & myRecordSet.Fields(7).Value & "', "
StrSQL3 = StrSQL3 & " '" & myRecordSet.Fields(8).Value & "', "
StrSQL3 = StrSQL3 & " '" & myRecordSet.Fields(9).Value & "' ) "
If OldEmail = email Then
DoCmd.RunSQL StrSQL3
这一切都很好,直到我得到这个客户:Location D'Outils Nicolet。由于客户端名称中的 ',我收到错误 3075 - Missing operator。
有没有人知道解决这个问题的方法?