Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to notify user when path is not accessable due to connection lost

Posted on 2007-04-03
2
Medium Priority
?
144 Views
Last Modified: 2010-08-05
I want to develop a simple databse application using VB6 and one of the function is to access a network path. How to notify user if the application not able to access the path due to connection lost or network breakdown? Pop up a msg instead of application error due to cannot access path?
0
Comment
Question by:mr_avril
2 Comments
 
LVL 54

Accepted Solution

by:
Ryan Chong earned 150 total points
ID: 18848612
>>Pop up a msg instead of application error due to cannot access path?

Yup, perhaps you need a better error handling here, like:

Sub YourProcess()
    on error goto ErrorHandler

    'your stuff here...

    Exit Sub
ErrorHandler:
    Msgbox "Connection Lost, blabla.."

'   Msgbox err.number & ":" & err.description

End Sub
0
 
LVL 12

Expert Comment

by:jkaios
ID: 18848631
The best way is to, at least, report a visual indication to the user when the path does not exist.

If Dir("\\server\somepath\", vbDirectory) = "" Then
   MsgBox "The specified path doesn't exist or is currently inaccessible!", vbCritical
End If
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question