Results 1 to 10 of 10

Thread: [2005] Database Connection

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2006
    Posts
    100

    [2005] Database Connection

    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!

  2. #2
    A SQL Server fool GaryMazzone's Avatar
    Join Date
    Aug 2005
    Location
    Dover,NH
    Posts
    7,493

    Re: [2005] Database Connection

    You could do a File Exsists check. What version of VB are you using?
    Sometimes the Programmer
    Sometimes the DBA

    Mazz1

  3. #3

    Thread Starter
    Lively Member
    Join Date
    May 2006
    Posts
    100

    Re: [2005] Database Connection

    2005. Would that work better than a ping test? Looking for something that could run fairly quick as well.

    Thanks!

  4. #4
    A SQL Server fool GaryMazzone's Avatar
    Join Date
    Aug 2005
    Location
    Dover,NH
    Posts
    7,493

    Re: [2005] Database Connection

    That should be quick. Try Sustem.IO.FileExsist(filename)
    Sometimes the Programmer
    Sometimes the DBA

    Mazz1

  5. #5
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: [2005] Database Connection

    Wouldn't it be simpler, and far less code, to just error trap the connection code, and run with it?

  6. #6

    Thread Starter
    Lively Member
    Join Date
    May 2006
    Posts
    100

    Re: [2005] Database Connection

    Can you give me a code example of the error trap? Thanks!

  7. #7
    A SQL Server fool GaryMazzone's Avatar
    Join Date
    Aug 2005
    Location
    Dover,NH
    Posts
    7,493

    Re: [2005] Database Connection

    That would the depend on the programing language you are using
    Sometimes the Programmer
    Sometimes the DBA

    Mazz1

  8. #8

    Thread Starter
    Lively Member
    Join Date
    May 2006
    Posts
    100

    Re: [2005] Database Connection

    Visual Basic

  9. #9
    A SQL Server fool GaryMazzone's Avatar
    Join Date
    Aug 2005
    Location
    Dover,NH
    Posts
    7,493

    Re: [2005] Database Connection

    VB6? VB.Net 2003? .Net 2005? .Net 2008?
    Sometimes the Programmer
    Sometimes the DBA

    Mazz1

  10. #10
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: [2005] Database Connection

    If you are using VB.NET 2005, then you would use the Try/Catch/Finally method of error trapping.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width