Results 1 to 7 of 7

Thread: What is the best way to test connectivity?

  1. #1
    Join Date
    Aug 2004
    Location
    USA
    Posts
    80

    What is the best way to test connectivity?

    Hello Everyone,

    What is the best way to test connectivity with the database from the application on a frequest basis?

    Thanks.

  2. #2
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,932
    Run osql.exe and use "select @@version" query.

  3. #3
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254

  4. #4
    Join Date
    Aug 2004
    Location
    USA
    Posts
    80
    Thanks MAK, but I just need one server to check for now..that should be done by application owner, not the DBA in this case..any idea?

  5. #5
    Join Date
    Sep 2002
    Posts
    5,938
    may try odbcping.

  6. #6
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254
    or a VbScript with ADO like below


    'on error resume next
    'Author: MAK
    'Contact: mak_999@yahoo.com
    'Check Connectivity
    Dim AdCn
    Dim AdRec
    Dim i, SQL
    Set AdCn = CreateObject("ADODB.Connection")
    Set AdRec = CreateObject("ADODB.Recordset")
    AdCn.Open = "Provider=SQLOLEDB.1;Data Source=Xq12;Initial Catalog=weekly;user id = 'reboot';password='reboot123' "
    SQL="Select @@version as name"
    AdRec.Open SQL, AdCn,1,1
    xxx=Adrec("name")
    if left(xxx,5)<>"Micro" then
    msgbox "Can't connect to the database"
    end if

  7. #7
    Join Date
    Aug 2004
    Location
    USA
    Posts
    80
    thanks MAK.

Posting Permissions

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