Click here to Skip to main content
15,884,425 members
Articles / Programming Languages / C++
Article

Error Handling In Visual Basic Projects

Rate me:
Please Sign up or sign in to vote.
1.29/5 (7 votes)
15 Oct 20072 min read 32.4K   9   4
Insert Error Hanler In Your Visual Basic Projects Easily

Download Error Handler (Right Click And Select Save Target As... )

URL For Download: http://helia2000.tripod.com/index_files/ErrorHandler.htm

Hello

When A System Developed By Programmer The Important Step IS Supporting System and

Debugging System The most Popular Step Is Reporting Bugs By Users That Using This Systems But Somtimes Users Dont Reports Error.

My End Goal Of This Error Handler Program Is Help to VB system Developers To Reporting This Bugs. This System Is Very UseFull Tools For This Idea.It Is Inserts Error HAndler Tag In Vb Forms By This Error Handling You Can see Which User Have Error and What Is The error Descrpition And Which Module Or form Or UserControl Or Reports Has erros And In This Form Or UserControl Or Reports Which Function Or Sub Has errors .

You Can Remove This Error Handler TAg After Inserting Easily.

I Use This Syetem In Four Big Syestem Like Accounting... And I Acquiesce from This Tool

Please Send Me your FeedBack About This Program To Improve It.

Thank you

ErrorHandling Main Maenu

Error Handler Config Menu

Sample Code Before Change

Private Sub Form_Load()
'My Code Starts here

'My code end Here


End Sub

Sample Code After Inserting Error Handler

Private Sub Form_Load()
On Error GoTo Err_Label: '*ErrorHandler Tag*'
Dim StrSubName As String '*ErrorHandler Tag*'
Dim ErrorDescription As String '*ErrorHandler Tag*'
StrSubName = "Form_Load" '*ErrorHandler Tag*'
Me.MousePointer = 11 '*ErrorHandler Tag*'

'My Code Starts here

'My code end Here


Me.MousePointer = 1 '*ErrorHandler Tag*'
Exit Sub '*ErrorHandler Tag*'
Err_Label: '*ErrorHandler Tag*'

ErrorDescription = Me.Name + "-->" + StrSubName + "-->" + Err.Description '*ErrorHandler Tag*'
MsgBox ErrorDescription + vbCrLf + "Please Contact With Your System Administrator", vbCritical, "ERROR HANDLER" '*ErrorHandler Tag*'
MousePointer = 1 '*ErrorHandler Tag*'
ErrorDescription = Replace(ErrorDescription, "'", " ") '*ErrorHandler Tag*'
MainConnection.Execute "INSERT INTO Errors_Log (ComputerName,Error_Date,Error_Time,UserName,Error_Description) VALUES ('" + sGetComputerName + "','" & Date & "','" & Time & "','" & CurUser & "','" & ErrorDescription & "')" '*ErrorHandler Tag*'
End Sub

Houshang Karami

Iran-Tehran

My Email Is: Houshang.karami@gmail.com

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
Iran (Islamic Republic of) Iran (Islamic Republic of)
i am programmer and i am programming 10 year
I am VB Progarammer
Asp.net Webdevelpoer Intranet Site Developer
C#.net Programmer
in SqlServer DatabAse
I am Developing Accounting System And Sell Systems
In C# Or VB.net In SqlServer 2000 ,
I like Programming And I live With Programming
iran tehran



Comments and Discussions

 
GeneralYour Answers Pin
hooshang Karami4-Sep-05 17:44
hooshang Karami4-Sep-05 17:44 
Question??? Pin
pgiustinoni4-Sep-05 4:56
pgiustinoni4-Sep-05 4:56 
AnswerRe: ??? Pin
Jim Crafton4-Sep-05 8:34
Jim Crafton4-Sep-05 8:34 
GeneralRe: ??? Pin
hooshang Karami14-Apr-07 0:00
hooshang Karami14-Apr-07 0:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.