Subject UDF problem
Author Leonel Pereda
Hi All

I translated my database FireBird 1.5 to 2.0, but sometime when I use certain functions give me error "Error reading data from the conection". One of the failing functions is

Code function in Delphi

function fnOnlyDate(F1 : PISC_QUAD): PISC_QUAD; stdcall;
begin
F1.gds_quad_low := 0;
Result := F1;
end;

Declaration function

declare external function fnOnlyDate
date returns date free_it
entry_point 'fnOnlyDate' module_name 'X.dll';

SQL example

SELECT FIRST 1 CON_ID
FROM DOC_CONSULTAS
WHERE (CON_TIPOCONSULTA = 1) AND (CON_ESTADO > 2) AND
(CON_PACIENTE = 1) AND (CON_ID <> 2) AND (fnOnlyDate(CON_FECHA) = '1/1/2007')



Someone can help me understand why?
Best regards,
Leonel