Click to See Complete Forum and Search --> : [2005] Database Connection
tonydotigr
Jan 23rd, 2008, 06:56 AM
I have an access database that resides on the network. What is the recommended method of verifying connectivity with this database before connecting the program. I'd basically just like to do a ping test or something to determine if the server is found if not throw a message.
Thanks all!
GaryMazzone
Jan 23rd, 2008, 07:25 AM
You could do a File Exsists check. What version of VB are you using?
tonydotigr
Jan 23rd, 2008, 08:00 AM
2005. Would that work better than a ping test? Looking for something that could run fairly quick as well.
Thanks!
GaryMazzone
Jan 23rd, 2008, 08:14 AM
That should be quick. Try Sustem.IO.FileExsist(filename)
Hack
Jan 23rd, 2008, 08:15 AM
Wouldn't it be simpler, and far less code, to just error trap the connection code, and run with it?
tonydotigr
Jan 23rd, 2008, 04:37 PM
Can you give me a code example of the error trap? Thanks!
GaryMazzone
Jan 24th, 2008, 07:33 AM
That would the depend on the programing language you are using
tonydotigr
Jan 24th, 2008, 08:03 AM
Visual Basic
GaryMazzone
Jan 24th, 2008, 08:09 AM
VB6? VB.Net 2003? .Net 2005? .Net 2008?
Hack
Jan 24th, 2008, 08:21 AM
If you are using VB.NET 2005, then you would use the Try/Catch/Finally method of error trapping.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.