How to detect a running SQL Server from Access?

  • Thread starter Thread starter Vincent Verheul
  • Start date Start date
V

Vincent Verheul

Hi!

I have an Access Front-End that can both use an Access Back-End as well as a
SQL Server database. I use VBA with the DAO library. To connect to the SQL
Server I use a ODBC connection.

I'm looking for VBA logic to detect any running SQL Server instances that a
user can select. This is to avoid a long 'hang-up' period that occurs when a
SQL Server is specified that does not exist or is off-line.

I tried the ODBCtimeout property of a QueryDef but that does not seem to
help when the SQL Server is off line.

Any ideas?

Thanks,
Vincent
 
Hi,
My advice to you is to google on this:
"visual basic" list available sql servers

You'll get tons of hits. Most code will use the SQLDMO library
but here is a link to VB sample program which uses NetServerEnum
but wrapped up in a class. I don't know your coding level but it may help.

http://www.codeproject.com/useritems/listsqlservers.asp
 
Hello Dan,

Thanks a lot! The advantage of the link that you provided is that it's not
using the SQLDMO library that usually is not present on the machine of user.
I'll have to get to the office to test it since I do not have access to the
domain right now.

Vincent
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top