PerlIsGood
Programmer
Can anyone point out the problem/error in the following SQL query?
When I remove the WHERE clause it will pull a record from the database, not the one I need, but the code itself works. I just need to figure out how to get the variable into the statement so that I can pull the correct info...
Running the code with the WHERE clause in place I get this error:
Run-time error: 'numbers...
No value given for one or more required parameters
Any help would be greatly appreciated Notorious P.I.G.
Code:
rst.Open _
"SELECT * FROM tblClients WHERE [Billing Code] = " & UCase(sClientCode), _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & FileLoc & ";"
For Each fld In rst.Fields
MsgBox fld.Value & ";"
Next
When I remove the WHERE clause it will pull a record from the database, not the one I need, but the code itself works. I just need to figure out how to get the variable into the statement so that I can pull the correct info...
Running the code with the WHERE clause in place I get this error:
Run-time error: 'numbers...
No value given for one or more required parameters
Any help would be greatly appreciated Notorious P.I.G.