run time error “3061” : too few parameters, expected 1

前端 未结 2 1450
谎友^
谎友^ 2021-01-27 00:59

VB6 (32 BIT - 1998) ERROR 3061 - WINDOWS 7 - ACCESS 2007 - EXCEL 2007

I wrote a VB6 program that extracts records from an ACCESS 2007 database and writes them into an EX

相关标签:
2条回答
  • 2021-01-27 01:37

    If you're certain the SELECT statement in your question is the exact statement built by your code, copy that text, create a new query in the Access query designer, switch to SQL View, paste in the copied text and try to run it.

    Access will present a parameter input box asking you to supply a value for the parameter. Notice that box includes the "name" of whatever Access thinks is the parameter. That parameter name is something (often a misspelled field name) Access can't find in the VALORES_GENERADORES table. Since it can't find the name, it assumes the name must be a parameter.

    0 讨论(0)
  • 2021-01-27 01:54

    THANK YOU, HANSUP, YOUR SUGGESTION SOLVED THE PROBLEM!!!

    This is a set of daily databases provided to me by a third party. The database structure and the table fields have not changed in the last years. Furthermome, my program worked fine extracting daily info for almost a year!! Then, at the same time my PC commited suicide, the database designer decided to CHANGE THE NAME OF THE LAST FIELD IN THE TABLE I QUERY. Hi did this wierd thing in the midlle of a month (@#!##!!!). When I checked the field names of the table, I looked at the day 1 database table, which still had the old name!!! So, I thougth my re-installing everything was the culprit.

    Now I changed the field name (it was not a misspelling or syntax error) and everything is back to normal again.

    Thanks again!!!

    Rudy

    0 讨论(0)
提交回复
热议问题