Error retriving HyperFile string field as date
Brought to you by:
edwardbenson
An occur when a char field identified as date is blank.
I'have modified the function TSqlCursorOdbc.getDate in
DbxOpenOdbc.pas and it seems work.
with fOdbcHostVarAddress.ptrSqlDateStruct^ do
// Integer(Value^) := ((365 * 1900) + 94) + Trunc(
EncodeDate(Year, Month, Day) );
try
Integer(Value^) := ((365 * 1900) + 94) + Trunc(
EncodeDate(Year, Month, Day) );
except //EL
//Renvoyer une valeur null pur la date
IsBlank := True;
Integer(Value^) := 0
end;
Logged In: YES
user_id=644745
Interestingly. What DBMS for you?
Logged In: YES
user_id=644745
Try such variant:
function TSqlCursorOdbc.getDate(...
...
IsBlank := (fColValueSizePtr^ = OdbcApi.
SQL_NULL_DATA) or
(fColValueSizePtr^ = OdbcApi.SQL_NO_TOTAL) or
(fOdbcHostVarAddress.ptrAnsiChar^ = ' ');
Logged In: YES
user_id=1307053
The DBMS is HyperFile. It's the DBMS of the french
developpement tools WINDEV.
Your code works but I had to replace ' ' by ''
So :
function TSqlCursorOdbc.getDate(...
...
IsBlank := (fColValueSizePtr^ = OdbcApi.
SQL_NULL_DATA) or
(fColValueSizePtr^ = OdbcApi.SQL_NO_TOTAL) or
(fOdbcHostVarAddress.ptrAnsiChar^ = '' );
Thanks a lot !