Subject | Re: Antw: Re: [IBO] TIBOQuery ParamsByName SQL Error -804 data |
---|---|
Author | Uwe Cramer |
Post date | 2002-02-17T13:50Z |
Hello Helen and thanks,
i try to change from "tdate" to"tdateTime" and "asDateTime" but
the error is the same. i also get the error if i use a "String" with
"asString"and i got the error in the line
Query.ParamByName('MySearchDate').asDateTime := MyDateVar;
not later in the line with "open"
can i set the param datatype before to avoid this errors?
regards Uwe
i got the error not after "open"
At 02:56 PM 17-02-02 +0200, you wrote:
the wrong type, or (as in your case) an unknown type, you will get a
database exception.
i.e. the database is receiving this statement:
select * from MyTable where MyDateField = 'some string'
or
select * from MyTable where MyDateField = <some date>
Neither is recognised by the database as DATE.
You can pass either a Date Literal in an SQL statement which you construct
yourself (not recommended; and you can't use a parameter for this as it is
not a string type) or you can pass a TDateTime. TDate is not the right
format for converting to a Dialect 3 DATE type.
Change MyDateVar to a TDateTime and do
Query.ParamByName('MySearchDate').asDateTime := MyDateVar;
regards,
Helen Borrie (TeamIBO Support)
** Please don't email your support questions privately **
Ask on the list and everyone benefits
Don't forget the IB Objects online FAQ - link from any page at
www.ibobjects.com
___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info
papers,
keyword-searchable FAQ, community code contributions and more !
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
i try to change from "tdate" to"tdateTime" and "asDateTime" but
the error is the same. i also get the error if i use a "String" with
"asString"and i got the error in the line
Query.ParamByName('MySearchDate').asDateTime := MyDateVar;
not later in the line with "open"
can i set the param datatype before to avoid this errors?
regards Uwe
i got the error not after "open"
>>> Helen Borrie (TeamIBO<helebor@... ")"Newsgroups> 17.02.200211:31:35 >>>
At 02:56 PM 17-02-02 +0200, you wrote:
>IB Version is "6.0.1.0" Dialect is "3"No, the parameter is checked by the database during Prepare and, if it is
>"MyDateVar" in Delphi is "tdate"
>"MyDateField" in IBtable is "Date"
>? "MySearchDate" ?
>? Parameter is only defined in the Statement ?
the wrong type, or (as in your case) an unknown type, you will get a
database exception.
i.e. the database is receiving this statement:
select * from MyTable where MyDateField = 'some string'
or
select * from MyTable where MyDateField = <some date>
Neither is recognised by the database as DATE.
You can pass either a Date Literal in an SQL statement which you construct
yourself (not recommended; and you can't use a parameter for this as it is
not a string type) or you can pass a TDateTime. TDate is not the right
format for converting to a Dialect 3 DATE type.
Change MyDateVar to a TDateTime and do
Query.ParamByName('MySearchDate').asDateTime := MyDateVar;
regards,
Helen Borrie (TeamIBO Support)
** Please don't email your support questions privately **
Ask on the list and everyone benefits
Don't forget the IB Objects online FAQ - link from any page at
www.ibobjects.com
___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info
papers,
keyword-searchable FAQ, community code contributions and more !
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/