Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disk or network error

Status
Not open for further replies.

wilberforce2

IS-IT--Management
Jan 8, 2007
36
GB
I have a VB6 app running across the network connected to a database. I am getting occasional Disk or network errors and was wondering how the best way to trap the error so that the app does not bomb out. The app uses a mapped network drive that works fine after a disk or network error occurs. The database seams to be more sensitive.

Any ideas would be appreciated.

Thanks
 
Inline example:
Code:
on error resume next
do
    err.clear
    [code=line to access network goes here]
loop until err.number = 0

Handler example:
Code:
on error goto errhandle
[code=line to access network goes here]
exit sub 'always put before errhandle tag, to avoid executing error handler if error doesn't occur
errhandle: 'best at end of code
if err.number = [number of error you're trapping] then
     resume 'here you could put a counter and quit if you've tried to resume x times
end if


HTH

Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top