R
Rizza
I am using VBA and ADO to search my db's tables for specific characters.
It errs when the data contains a single quote.
I also cannot search for a single quote or percent.
I understand why based on my sql string.
Recordset:
strSQL = "SELECT [Tbl Fields].*, [Tbl Type Values].Type FROM [Tbl Fields]
INNER JOIN" & _
" [Tbl Type Values] ON [Tbl Fields].FTN=[Tbl Type Values].FTN" &
_
" WHERE [Tbl Fields].
Like 'source_' & '%' AND [Type]
like '" & _
strCombo & "' & '%' ORDER BY
"
When the recordset increments this is the code:
DoCmd.RunSQL "INSERT INTO [Tbl Search Report](
, [Field], [Data])
SELECT '" & _
strTbl & "', '" & strFld & "', '" & rstCurTbl(0) &
"'"
My thought right now is to store the data in an array or last/worst case to
pass some variables to some access queries.
I am not sure how to put the array into the sql statement. I want to update
once per field.
Any advice is appreciated thanks.
It errs when the data contains a single quote.
I also cannot search for a single quote or percent.
I understand why based on my sql string.
Recordset:
strSQL = "SELECT [Tbl Fields].*, [Tbl Type Values].Type FROM [Tbl Fields]
INNER JOIN" & _
" [Tbl Type Values] ON [Tbl Fields].FTN=[Tbl Type Values].FTN" &
_
" WHERE [Tbl Fields].
like '" & _
strCombo & "' & '%' ORDER BY
When the recordset increments this is the code:
DoCmd.RunSQL "INSERT INTO [Tbl Search Report](
SELECT '" & _
strTbl & "', '" & strFld & "', '" & rstCurTbl(0) &
"'"
My thought right now is to store the data in an array or last/worst case to
pass some variables to some access queries.
I am not sure how to put the array into the sql statement. I want to update
once per field.
Any advice is appreciated thanks.