This function can be used to determine if a server can be located, and optionally, if it a successful connection to a database can be made.
unsigned int db_string_ping_server( SQLCA * sqlca, char * connect_string, unsigned int connect_to_db );
If connect_to_db is zero, then the function only attempts to locate a server. It returns TRUE only if the connection string is sufficient to locate a server. It makes no attempt to connect to the database.
TRUE (non-zero) if the server or database was successfully located; FALSE (zero) otherwise. Error information for locating the server or database is returned in the SQLCA.