Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

error: too few parameters.expected 1.

Status
Not open for further replies.

49er

Programmer
Aug 24, 2000
38
0
0
US
I am trying to connect to a dbase file via ADO using the code below. If I drop the WHERE portion of strQuery then it works. However, I don't see anything wrong the WHERE portion of the query. The error I receive is "too few parameters. Expected 1." Any ideas please? Thanks.

Code:
strQuery = "SELECT * FROM BMs.dbf WHERE bncmrk = 'A1'"
Set adoRS = New ADODB.Recordset
adoRS.Open strQuery, db, adOpenStatic, adLockReadOnly
 
Hi,

is bncmrk a string or is it a numeric value?

if it is numeric you must not use single quotes
another possible fault is
is there a space between = an the value you look up?
No space is admitted there

.....WHERE bncmrk ='A1'"

I suppose the spelling of bncmrk is wright

Otherwise I don't see what could be wrong

 
Hi 49er,

You often get this error come up when you create a recordset with sql - a field name in sql is mistyped or the field doesn't exist in the table.

is bncmrk field spelt correctly?

Hope this helps,


Codefish
 
I sometimes brain-dump and use the variable name in place of the column name. That will definitely produce this error.
Is 'bnchmrk' the program variable?
If you open the db, will you see 'bnchmrk' as a column withing the table?
Good luck,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top