Autor Beitrag
Soulama
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 72



BeitragVerfasst: Di 06.06.06 11:43 
Hallo zusammen,
ich habe in meinem Delphi7 Projekt eine Globalefehlerprocedur geschriben:
ausblenden Delphi-Quelltext
1:
   Application.OnException:= MyException ;					

das fonctioniert soweit in Ordnung, nun bekomme ich ab und zu diesen Fehler:
ERROR 10.05.2006 14:50:32 : Das Datum überschreitet das Maximum von 09.05.2006
wobei der String: 09.05.2006 variable ist.
Mein Probleme ist: wie kann ich feststellen woher der Fehler kommt, in welcher unit, welsche zeile...
Jede Idee ist willkommen.
Danke
Mindforce
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 358

Win XP Pro / MCE, Win 98, Slax (Linux)
Delphi 07 PRO, Delphi 3+7 (mit Prdx)
BeitragVerfasst: Di 06.06.06 12:07 
Hi,

mach mal n Foto und Poste es hier mal...

Gruss,

Mindforce

_________________
Our force; in mind.
Soulama Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 72



BeitragVerfasst: Di 06.06.06 12:19 
N'Photo gibt es leider nicht, die Meldung wird in einer Logfile geschrieben :(
Mindforce
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 358

Win XP Pro / MCE, Win 98, Slax (Linux)
Delphi 07 PRO, Delphi 3+7 (mit Prdx)
BeitragVerfasst: Di 06.06.06 12:21 
Hi,

achso schade...

Gruss,

Mindforce

_________________
Our force; in mind.
azubi_20
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 593

WinXP SP2, Ubuntu 8.4
D7 Enterp., D2005 Prof., Java (Eclipse 3.4.0)
BeitragVerfasst: Di 06.06.06 12:51 
Ist der Fehler reproduzierbar ?
Welche Codeteile haben was mit Datumswerten zu tun ?
Poste mal deine Globalefehlerprocedur...
Soulama Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 72



BeitragVerfasst: Di 06.06.06 13:05 
Hi,
MyException Code:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
  procedure TMyDataModule.MyException(Sender: TObject; E: Exception);
var
   ErrorLogFileName : string;
   ErrorFile : TextFile;
   ErrorData : string;
begin
   ErrorLogFileName := AP + StrGeneralLog;
   AssignFile(ErrorFile, ErrorLogFileName) ;

   {$I-}
   //either create an error log file, or append to an existing one
   if FileExists(ErrorLogFileName) then
     Append(ErrorFile)
   else
     Rewrite(ErrorFile) ;
   if ioresult<>0 then exit;
   {$I+}
   try
     //add the current date/time and the exception message to the log
     ErrorData := Format('ERROR unknow %s : %s',[DateTimeToStr(Now),E.Message]) ; 
     WriteLn(ErrorFile,ErrorData) ;
   finally
     CloseFile(ErrorFile)
   end;

   //Show the exception
   Application.ShowException(E) ;
end;

Hab versucht den Fehler zu reproduzieren, habs leider nicht geschafft.
Es geht in meinem Projekt um Tarifdateien zu bearbeiten.
Die Tarife sind in einer datenbank gespeicher, jeder Tarif ist zu einem bestimten Datum gültig.
Der Fehler passiert öfter wenn der Rechner für 3 oder 4 Tage an bleibt, ich vermute dass ich irgendwo eine Globale variable habe die ich am Anfang setze und die immer als aktueller Datum benuze, hab die ganze zeit danach gesucht hab nichts gefunden.