I have a lot of problems with Pervasive 2000i SP4 (NT and Netware). The most importent are:

1. When I call select command like below

select count(*) from tblSAMOCHODY s inner join tblFAKT_ZAK f
on s.nID_SAM = f.nID_SAM
where if(f.dDATA_faktury>f.ddata_przyjecia, if(f.ddata_faktury>s.dprzyjecie_data,f.ddata_faktu ry,dprzyjecie_data),
if(f.ddata_przyjecia>s.dprzyjecie_data,f.ddata_fak tury,ddata_przyjecia)) < '2003-05-27'

then server hungs up with windows error access violation. The respondent fragment of dr watson log is

Application exception occurred:
App: (pid=632)
When: 2003-05-27 @ 10:36:46.281
Exception number: c0000005 (access violation)
632 NTDBSMGR.exe

The problem is clear to me - MKDE implementation error. In this case problematic expression is nested if function.

If anybody knows how to solve this problem (in other way than changing expression) please, give me some advices.

2. My firm's application developed with Delphi 6.0 + BDE/ODBC database access hungs up server. It may be caused by server errors similar to above error. But How can I trace what operations are executed on server? Standard Debuging generates misunderstood for me file. Does anybody know better tool?

Best regards,

Grzegorz Gruza