PDA

View Full Version : Solved: Checking an ODBC connection programmatically



miltonr
04-27-2009, 04:18 PM
Hi:
I'm new to this forum, and to forums in general, and would like some help on how to go about checking whether or not a connection to a MS SQL server is active or not.
I've developed an application that retrieves data from several tables located on a SQL server.
I'll like to be able to check that all required SQL tables are linked and accessible and be able to do this from my Splash screen.
Any suggestions?

Milt:whip

CreganTur
04-28-2009, 05:23 AM
Welcome to the forum- always good to see new members.

Check out this thread (http://stackoverflow.com/questions/632385/how-can-i-best-use-vba-in-access-or-excel-to-test-an-odbc-connection), especially the second post. It shows how to open a connection to your DSN, and then check the state of the connection.

HTH:thumb