Data Error

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top