In one of my queries I am trying to retrieve the month from a date field. Using the DATEPART() function for this as follows:
SELECT DATEPART("m",[Datum]) AS Datum_uitgifte FROM Norm
This query works fine if I execute it in the query design window in Access, but as soon as I try to use this exact same query from my Visual Basic 6 application using ADO, I get the following error:
Run-time error '-2147217904 (80040e10)':
[Microsoft][ODBC Microsoft Access-driver] Too few parameters. Expected 1
A Google search on this error revealed that it often occurs when you try to refer to a column that doesn't exist. Figured that might be it, but I doublechecked my table and column names and they're just fine. (Besides, if they weren't, why would the query work in Access?)
This one has me stumped. Anybody know what I'm overlooking?
SELECT DATEPART("m",[Datum]) AS Datum_uitgifte FROM Norm
This query works fine if I execute it in the query design window in Access, but as soon as I try to use this exact same query from my Visual Basic 6 application using ADO, I get the following error:
Run-time error '-2147217904 (80040e10)':
[Microsoft][ODBC Microsoft Access-driver] Too few parameters. Expected 1
A Google search on this error revealed that it often occurs when you try to refer to a column that doesn't exist. Figured that might be it, but I doublechecked my table and column names and they're just fine. (Besides, if they weren't, why would the query work in Access?)
This one has me stumped. Anybody know what I'm overlooking?