Board index » delphi » Access 97 Parameters BUG (The application has improperly defined a Parameter object)

Access 97 Parameters BUG (The application has improperly defined a Parameter object)

Hello,

[Delphi 5 enterprise, ADO patcth and Access 97 database]

I used a parametrised SQL statement as usually in Delphi (parameters
beginning with a colon). One of parameters was of type TDateTime. It turned
out that such parameters are interpreted incorrectly. That is, when both day
and month are less than 13, somewhat (either ADO, either Delphi, either
Access driver) confuses day with month, so instead of 5th of March it saves
3rd of May, etc. This seems to be a bug, so please TeamB check this. But
this is not all yet.

To fix this, I decided to try to create a parametrised query in Access, like
the following:

PARAMETERS parStartDate DateTime, parCode Text, parParentID Long, parID
Long;
INSERT INTO ................................................;

To execute the query I use an ADOCommand with CommandType set to
cmdStoredProc. Delphi shows the name of the query in the drop down list in
Object Inspector ok; however, it does not recognize parameters
automatically. So when I try to execute the command, it raises the error
"Too few parameters. Expected 4". When I setup parameters manually it gives
the error "The application has improperly defined a Parameter object").

I tried to change the word "PARAMETERS" to "PROCEDURE", however, this does
not change anything.

Please help to solve this, in particular, how to use a query with a DateTime
parameter so that it won't confuse day with month.

Thanks,
Ruslan

 

Re:Access 97 Parameters BUG (The application has improperly defined a Parameter object)


Quote
Alex Suhov <alexp...@hotmail.com> wrote in message

news:88g9cu$n8m4@bornews.borland.com...
: Hello,
:
: [Delphi 5 enterprise, ADO patcth and Access 97 database]
:
: I used a parametrised SQL statement as usually in Delphi (parameters
: beginning with a colon). One of parameters was of type TDateTime. It
turned
: out that such parameters are interpreted incorrectly. That is, when both
day
: and month are less than 13, somewhat (either ADO, either Delphi, either
: Access driver) confuses day with month, so instead of 5th of March it
saves
: 3rd of May, etc. This seems to be a bug, so please TeamB check this. But
: this is not all yet.

Which date format are you using?  The Access documentation says clearly that
dates in SQL statements should be in US (mm/dd/yy) format.

--

"Qui plume a, guerre a." (Who writes, fights.)
Voltaire

Other Threads