Re: Programmatically test if DB server is alive? by kenfine
kenfine
Wed May 17 11:45:43 CDT 2006
Super, very helpful, thanks, Luke.
-KF
"Luke Zhang [MSFT]" <lukezhan@online.microsoft.com> wrote in message
news:FGChFqVeGHA.4672@TK2MSFTNGXA01.phx.gbl...
> Hello,
>
> To detect a Database is availeble, you may just open a connection to it
> and
> catch possible error. For example:
>
> Con.Open "Provider=SQLOLEDB; Data
> Source=localhost;database=northwind;integrated security=SSPI"
>
> If Err.Number <> 0 Then
> ..
> Else
> ..
>
> If there is any error after opening a connection, we can think this server
> is not availeble currently and redirect to backup server.
>
> Regards,
>
> Luke Zhang
> Microsoft Online Community Support
>
> ==================================================
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ==================================================
>
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>