不再讓錯誤石沉大海,捕捉使用者操作時發生的錯誤,以利資料人員後續追蹤!
原理說明:用一個大的例外處理,進行攔截程式中引外的錯誤!
實作:
1.
1: /*系統發生異常記錄用*/2: CREATE TABLE SYS_ERR_REPORT
3: (
4: RECDATE DATETIME,
5: USERNAME VARCHAR(20),
6: SYSTYPE VARCHAR (3),
7: FORMNAME VARCHAR(50),
8: MENUCAPTION VARCHAR(50),
9: ERRTYPE VARCHAR(30),
10: ERRMESSAGE VARCHAR(200),
11: CONSTRAINT PK_SYS_ERR_REPORT
12: PRIMARY KEY(RECDATE)
13: )
在MainFm上放(Additional-ApplicationEvents)
{ font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } ]]>
=> =>