SQL Server up? 
Author Message
 SQL Server up?

I'm working on a VB program that writes to both an Acess db and a SQL Server
Db simulatenously...  Is there a way in code to check and make sure the SQL
Server is up so if it isn't I can make sure that the new data is written
there when it comes back online?

Thank You....

Jeff



Sat, 01 Dec 2001 03:00:00 GMT  
 SQL Server up?
Try to open an ADO connection to the database you want to use on the server
and execute a test command. (such as executing a count query)
If the connection succeeds and the query works then SQL is up otherwise
you'll  get an error message.

Quote:

>I'm working on a VB program that writes to both an Acess db and a SQL
Server
>Db simulatenously...  Is there a way in code to check and make sure the SQL
>Server is up so if it isn't I can make sure that the new data is written
>there when it comes back online?

>Thank You....

>Jeff



Sat, 01 Dec 2001 03:00:00 GMT  
 SQL Server up?
Hi Jeff

Use win32 API function QueryServiceStatus function which retrieves the
current status of the specified service.

BOOL QueryServiceStatus
(
          SC_HANDLE hService,  // handle of service
          LPSERVICE_STATUS lpServiceStatus
                               // address of service status structure
);

I hope this provides a solution to your problem. If you need any more
information on this please get back to me. I'll be glad to help you.

Regards,
-Vijay
---------------------------------
Vijay Kumar Reddy J

www.e-supportpoint.com


Quote:
> I'm working on a VB program that writes to both an Acess db and a SQL
Server
> Db simulatenously...  Is there a way in code to check and make sure the
SQL
> Server is up so if it isn't I can make sure that the new data is written
> there when it comes back online?

> Thank You....

> Jeff



Sun, 23 Dec 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. sql server connect. Migration Access->sql server

2. Can not find SQL Server (I'm not using SQL Server)

3. sql server connect. Migration Access->sql server

4. sql server connect. Migration Access->sql server

5. VB Sql Server Via ADO Problem: [Microsoft][ODBC Sql Server Driver]

6. VB6 application using SQL Server 2000 migrating db to SQL Server 2

7. Using Vbscript and SQL-DMO to connect to SQL Server and run a T-SQL script

8. Listing Servers Running SQL Server

9. How to rename a SQL Server table in Server Explorer

10. SQL-Optimizer/DBA, the Intelligent Server Monitor for Oracle Servers

11. List SQL Server Servers, Databases and Tables

12. can't install sql server debugging on server

 

 
Powered by phpBB® Forum Software