Question

I want to shut down SQLServer and close the SQLBase window that it opens up. Is there a way to shut down the server and close this window? Any sql sommand or anything of that sense.. I could shut it down using OpenProcess() and then TerminateProcess() but it doesn't seem clean and I couldn't use it in my scenario. Just using db.Close() doesn't work.This is the code:

    CDatabase db;    
    db.OpenEx("DSN=PCPAYWIN;DB=PAY4WIN;SRVR=;UID=PCPAYSYS;PWD=N42A17H1", 0);        
    CRecordset rc( &db);
    char sqlString[] = "select * from t_emp_pyrl_profile";  
    rc.Open(CRecordset::forwardOnly,sqlString,CRecordset::readOnly);

    //do stuff

    db.Close();

This is the server window:enter image description here

How to get the server to shutdown along with the window to close up? Thanks in advance

No correct solution

OTHER TIPS

???

You know what you ask?

I want to shut down SQLServer that opens up a window.

SQL server does not open a window, it is a windows service and can be controlled by the windows service API like any other installed service.

The window you show is SqlBase, which is not SqlServer (a product from microsoft, with trademark).

In that case you can only try sending windows messages. It seems the isntall did not make sure to run t aw windows service (which also is possible, a simple google searh reveals it), so possibly you are limited to just doing that. According to http://support.unify.com/Docs/SQLBase/Books/dba10/dba_windows_service.htm that would allow you to shut it down via services API, too.

But then - if that is not an option, sending windows messages should work, simulating menu actions.

Use command

SHUTDOWN

but show your window, because sql server does not shows windows at all.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top