Access ODBC exception
-
i've used the wizzard to add class derived from CRecordset for an access table (let's say CRSmytable). i get "Too few parameters. Expected 3" exception thrown by CRSmytable.Open(). Any ideea why? Or, at least..what does this exception mean?
The exception means what it says. You are passing fewer parameters to the function
CRecordSet::Open()
than what it expects. BTW Can you post the code?Nobody can give you wiser advice than yourself. - Cicero
-
i've used the wizzard to add class derived from CRecordset for an access table (let's say CRSmytable). i get "Too few parameters. Expected 3" exception thrown by CRSmytable.Open(). Any ideea why? Or, at least..what does this exception mean?
eusto wrote:
Too few parameters. Expected 3
You are passing less parameter's to the function where you are calling it.See if you are missing out on passing some parameter values to the function.
Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_
-
The exception means what it says. You are passing fewer parameters to the function
CRecordSet::Open()
than what it expects. BTW Can you post the code?Nobody can give you wiser advice than yourself. - Cicero
-
eusto wrote:
Too few parameters. Expected 3
You are passing less parameter's to the function where you are calling it.See if you are missing out on passing some parameter values to the function.
Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_
-
i've used the wizzard to add class derived from CRecordset for an access table (let's say CRSmytable). i get "Too few parameters. Expected 3" exception thrown by CRSmytable.Open(). Any ideea why? Or, at least..what does this exception mean?
-
i've used the wizzard to add class derived from CRecordset for an access table (let's say CRSmytable). i get "Too few parameters. Expected 3" exception thrown by CRSmytable.Open(). Any ideea why? Or, at least..what does this exception mean?
It means there is a discrepency between the number of columns being retrieved with the
SELECT
statement and the number of variables in the record set. Everything must match! I would also suggest setting a breakpoint withinCRecordset::Open()
and single-stepping through that method so you'll know exactly what is going on. Until you can narrow an exception or an assertion down to the actual line, you're just guessing.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
-
i'm not passing any arguments.. The constructor of the recordset recieves a pointer to the opend connection to the database. From what i know, it should do a "select * from table"... the code:
CRSLoads line(&pApp->db); line.Open();
And if you set parameters for it what happens?
WhiteSky
-
It means there is a discrepency between the number of columns being retrieved with the
SELECT
statement and the number of variables in the record set. Everything must match! I would also suggest setting a breakpoint withinCRecordset::Open()
and single-stepping through that method so you'll know exactly what is going on. Until you can narrow an exception or an assertion down to the actual line, you're just guessing.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
Thanks i've solved it. It was exactly what you've said. I'm not used to access, i usually had a sql server behind my applications. The problem was between keyboard and my chair. I've generated the recordset from one db file and was running the program on another one.