免费国产美女一级A作爱播放免费,日本动漫精品一区二区三区,ⅩⅩ国产全无遮挡无码,国产精品无码视频2020

  • <delect id="1z9bx"><center id="1z9bx"><ruby id="1z9bx"></ruby></center></delect>

      1. <u id="1z9bx"><sub id="1z9bx"></sub></u>

      2. Delphi下檢查SQL Server服務(wù)器當(dāng)前運(yùn)行狀態(tài)!

        發(fā)布時間:2024-02-29
        delphi下檢查sql server服務(wù)器當(dāng)前運(yùn)行狀態(tài)!
        要求:delphi下隨時監(jiān)控sql?。螅澹颍觯澹驙顟B(tài)。
        1、命令提示符下可用:telnet <sql server ip> 1433檢查。
        2、delphi下如何模擬實(shí)現(xiàn)上述功能。
        ———-
        原來做過:
        function getsqlserverstatus(lpszcomputername: lpctstr): integer;
        var
        ssstatus: service_status;
        dwoldcheckpoint: dword;
        dwstarttickcount: dword;
        dwwaittime: dword;
        dwstatus: dword;
        lpszservicename: lpctstr;
        schscmanager: sc_handle;
        schservice: sc_handle;
        begin
        if (lpszcomputername <> nil) and
        ((strcomp(lpszcomputername, \\\’127.0.0.1\\\’) = 0) or (strcomp(lpszcomputername, \\\’.\\\’) = 0)) then
        lpszcomputername := nil;
        lpszservicename := \\\’mssqlserver\\\’;
        schscmanager := openscmanager(
        lpszcomputername, //computer name
        nil, // servicesactive database
        sc_manager_all_access); // full access rights
        if schscmanager = 0 then
        getsqlserverstatus := -1; //machine not exists
        schservice := openservice(
        schscmanager, // scm database
        lpszservicename, // service name
        service_all_access);
        if schservice = 0 then begin
        closeservicehandle(schservice);
        getsqlserverstatus := -2; //sqlserver service not exists
        end;
        if not queryservicestatus(
        schservice, // handle to service
        ssstatus) then begin // address of status information structure
        getsqlserverstatus := -3; //myerrorexit(\\\’queryservicestatus\\\’);
        result := ssstatus.dwcurrentstate;
        end;
        //———-
        網(wǎng)上找的,看看有用不
        uses registry, shellapi, filectrl, unit2;
        {$r *.dfm}
        function isnt: boolean;
        begin
        result := (win32majorversion >= 4) and (win32platform = ver_platform_win32_nt);
        end;
        var
        isexists: boolean = false;
        function isexistsmssql: boolean;
        const
        mssqlserver = \\\’software/microsoft/mssqlserver\\\’;
        reg: tregistry;
        result := isexists;
        if result then exit;
        if not isnt then
        reg := tregistry.create else
        reg := tregistry.create(key_read);
        with reg do
        try
        reg.rootkey := hkey_local_machine;
        result := keyexists(mssqlserver);
        isexists := result;
        finally
        free;
        end;
        mssql_98startcommand = \\\’scm -action 1 -pwd "%s"\\\’;
        mssql_ntstartcommand = \\\’net start mssqlserver\\\’;
        mssql_98stopcommand = \\\’scm -action 6\\\’;
        mssql_ntstopcommand = \\\’net stop mssqlserver\\\’;
        function startmssql(pass: string): boolean;
        s: string;
        screen.cursor := crhourglass;
        if not isnt then
        s := format(mssql_98startcommand, [pass]) else
        s := mssql_ntstartcommand;
        try
        winexec(pchar(s), sw_hide);
        result := true;
        except
        result := false;
        end;
        screen.cursor := crdefault;
        function stopmssql: boolean;
        winexec(mssql_98stopcommand, sw_hide) else
        winexec(mssql_ntstopcommand, sw_hide);
        procedure tform1.button2click(sender: tobject);
        if startmssql(edpass.text) then
        messagebox(handle, \\\’啟動完成\\\’, \\\’完成\\\’, mb_ok mb_iconinformation);
        ———————————————-
        program project1;
        uses
        windows,
        winsvc;
        procedure runmssqlservice;
        srvhandle: sc_handle;
        service_status: _service_status;
        srvstatus : integer;
        try
        srvhandle := openscmanager(\\\’\\\’, services_active_database, sc_manager_all_access);
        srvhandle := openservice(srvhandle, pchar(\\\’mssqlserver\\\’), service_query_status or service_start);
        if queryservicestatus(srvhandle, service_status)
        then
        srvstatus := service_status.dwcurrentstate;
        if srvstatus = service_stopped
        winexec(\\\’scm -action 1 -slient 1 -service mssqlserver \\\’,sw_normal);
        except
        runmssqlservice;
        end.
        獲取sql server服務(wù)器列表的幾種方法
        一、 sql dmo
        描述:sql distributed management objects(sql分布式管理對象),存在于sqldmo.dll文件中,實(shí)際上是一個com 對象,通過調(diào)用sql dmo的listavailablesqlservers方法取得。
        上一個:RC0805DR-073K16L,0805 3.16KΩ 0.5% 1/8W 電阻
        下一個:電腦硬盤插線安裝圖片,硬盤跳線接法圖解

        ssd硬盤壽命檢查工具,大家用的那個SSD的測試軟件叫什么
        淋雨試驗(yàn)箱外體結(jié)構(gòu)是有什么組成的
        PDCFM43X104K631EFG電容
        數(shù)據(jù)分析怎么做教程,新手SEO如何做數(shù)據(jù)分析
        喝普洱熟茶,喝的是什么?
        怎么改變系統(tǒng)字體顏色(系統(tǒng)字體怎么改顏色)
        固態(tài)安裝系統(tǒng)后無法進(jìn)入系統(tǒng),在一個固態(tài)硬盤里裝了系統(tǒng)但是卻進(jìn)不去下面有圖片急急急
        氫氧化錳盤式干燥機(jī)優(yōu)點(diǎn)
        電磁熱量表介紹
        居住建筑面積如何計(jì)算?