G
Guest
I have a function in an ADO module that generates query text to run using the
execute method. Here's the generated query text:
"UPDATE TOPPS_CLAIMS SET AU_KEY = 101110 WHERE PAID_YYYYMM = '200704' AND
COR LIKE 'L*' AND COR NOT IN ('LM', 'LN') AND TRIM(MEMBER_SUB_PROGRAM) IN
('IEHA', 'IESR', 'IESS', 'IESU') AND (GROUP_NUMBER NOT LIKE '4?????' AND
GROUP_NUMBER NOT LIKE '5?????');"
This query works properly when I copy the code into a new Access SQL query
and run it. This particular one does not work when run with the execute
method in my function. Here is the portion of code from the function that
runs the query:
Dim strSQL as String
Dim cnnLocal As New ADODB.Connection
Set cnnLocal = CurrentProject.Connection
cnnLocal.CursorLocation = adUseClient
strSQL = <THE QUERY TEXT ABOVE>
cnnLocal.Execute strSQL, intAffected
I've tried several options on the line with intAffected that produce the
same results.
Please let me know if you have any ideas.
Thanks!
execute method. Here's the generated query text:
"UPDATE TOPPS_CLAIMS SET AU_KEY = 101110 WHERE PAID_YYYYMM = '200704' AND
COR LIKE 'L*' AND COR NOT IN ('LM', 'LN') AND TRIM(MEMBER_SUB_PROGRAM) IN
('IEHA', 'IESR', 'IESS', 'IESU') AND (GROUP_NUMBER NOT LIKE '4?????' AND
GROUP_NUMBER NOT LIKE '5?????');"
This query works properly when I copy the code into a new Access SQL query
and run it. This particular one does not work when run with the execute
method in my function. Here is the portion of code from the function that
runs the query:
Dim strSQL as String
Dim cnnLocal As New ADODB.Connection
Set cnnLocal = CurrentProject.Connection
cnnLocal.CursorLocation = adUseClient
strSQL = <THE QUERY TEXT ABOVE>
cnnLocal.Execute strSQL, intAffected
I've tried several options on the line with intAffected that produce the
same results.
Please let me know if you have any ideas.
Thanks!