Unanswered: How to Check using if SQL Server is running on a remote computer
I am about designing an access project file that connect to a SQL Server database : it could be either on the local computer or a remote workstation, this depending on where the front end is running.
Bypassing the default log on dialog box i have set my own form that users should use to connect on adp. Then using baseconnection string i connect the adp to sql server database.
My concern is how can i check from vba if the instance of SQL Server where my back end database is located is running in order to make
users knowing that due sql server service status off their connection
tentative will fail.
inform u i can check same from console management however i would to automate same controle from my adp and avoid that users have to operate such task...
IsSQLServerRunning = False
If Err.Number = -2147221504 Then
MsgBox ModuleName & " - Can not get access to Cresys SQL Server Database. " & _
"SQL Server does not exit or access is denied or Service is not running", vbCritical, SystemName & " - " & ModuleName
Code that call function
If IsSQLServerRunning(XMLReference(0), UserIdent, UserPwd) = True Then
sCreateConnection XMLReference(0), UserIdent, UserPwd, XMLReference(1)
MsgBox "Log In aborted due SQL Server database failure", vbCritical, SystemName & " - " & ModuleName