zoukankan      html  css  js  c++  java
  • lazarus for win32 serviceApp

    procedure TMyThread.Execute;
    begin
      //Application.EventLog.FileName:='d:xx.txt';
      //Application.EventLog.Info('OKOKOK');
      //DbgOutThreadLog('OOKKOOKK' +#13+#10);
      while not Self.Terminated do
      begin
        try
          SQLDBLibraryLoader1.ConnectionType := 'Firebird';
          SQLDBLibraryLoader1.LibraryName := 'D:Firebird_3_0fbclient.dll';
          SQLDBLibraryLoader1.Enabled := True;
          SQLDBLibraryLoader1.LoadLibrary;
          SQLConnector1.ConnectorType := 'Firebird';
          SQLConnector1.CharSet:= 'utf8';
          SQLConnector1.HostName:='192.168.1.102';
          SQLConnector1.DatabaseName:='d:firebird_3_0myDBjjw.fdb';
          SQLConnector1.UserName:='sysdba';
          SQLConnector1.Password:='jjw';
          SQLConnector1.Connected := True;
          SQLQuery1.SQL.Text:='select * from test';
          SQLQuery1.Open;
          SQLQuery1.Insert;;
          SQLQuery1.FieldByName('id').AsInteger:=100;
          SQLQuery1.FieldByName('msg').AsString:='ok';
          SQLQuery1.Post;
          SQLQuery1.ApplyUpdates;
          SQLTransaction1.Commit;
          SQLQuery1.Close;
          SQLConnector1.Close;
          SQLDBLibraryLoader1.Enabled := False;
          DbgAppendToFile('d:log.txt', 'ok'+#13+#10);
        except
          on E: Exception do
            DbgOutThreadLog(E.Message + 'ERROR_JJW' +#13+#10);
        end;
      end;
    end;                                                 

    调试和delphi一样,附加服务进程.

  • 相关阅读:
    MVC模式的学生信息增删改查
    常用排序算法
    2803 爱丽丝·玛格特罗依德
    3118 高精度练习之除法
    中秋练习题
    poj2011
    P1558 色板游戏
    P1830 轰炸III
    P1656 炸铁路
    1067 机器翻译
  • 原文地址:https://www.cnblogs.com/Jiaojiawang/p/12090783.html
Copyright © 2011-2022 走看看