N
Newbie
I have form that we I click a button it goes off to SQL Server and creates a
recordset. The records that are in the recordset I want to input into a
local table to run reports against
I use the following string and then loop through the records (see below)
which works fine except when there is a ' (single apostrophe) in the name.
How can I get round this problem?
The offending fields are:
rsCommission.Fields(1) and rsCommission.Fields(8)
Thanks
strQuery = "INSERT INTO SalesCommission Values('" &
rsCommission.Fields(0) & "', '" & rsCommission.Fields(1) & "', '" &
rsCommission.Fields(2) & "', " & rsCommission.Fields(3) & "," &
rsCommission.Fields(4) & ", " & rsCommission.Fields(5) & "," &
rsCommission.Fields(6) & ", " & rsCommission.Fields(7) & ", '" &
rsCommission.Fields(8) & "')"
recordset. The records that are in the recordset I want to input into a
local table to run reports against
I use the following string and then loop through the records (see below)
which works fine except when there is a ' (single apostrophe) in the name.
How can I get round this problem?
The offending fields are:
rsCommission.Fields(1) and rsCommission.Fields(8)
Thanks
strQuery = "INSERT INTO SalesCommission Values('" &
rsCommission.Fields(0) & "', '" & rsCommission.Fields(1) & "', '" &
rsCommission.Fields(2) & "', " & rsCommission.Fields(3) & "," &
rsCommission.Fields(4) & ", " & rsCommission.Fields(5) & "," &
rsCommission.Fields(6) & ", " & rsCommission.Fields(7) & ", '" &
rsCommission.Fields(8) & "')"