-
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.
-
Run osql.exe and use "select @@version" query.
-
-
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?
-
-
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
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|