日志函数

This commit is contained in:
sgwp 2024-10-25 10:20:49 +08:00
parent ad92d66f48
commit 4593757069

View File

@ -0,0 +1,45 @@
unit U_AdoFunc;
interface
uses
Windows, SysUtils, Messages, Classes, Controls, StdCtrls, ComCtrls, Forms,
ExtCtrls, ComObj, ActiveX, cxMemo, cxButtons, Graphics, IniFiles,
Dialogs, Menus, DB, ADODB,Dbclient ;
implementation
function writeSysLog(AdoCmd:TADOQuery;cds_data:TclientDataSet):boolean;
var
i:Integer;
mfieldName:string;
begin
result:=false;
try
with AdoCmd do
begin
close;
sql.clear;
sql.add('select * from SY_SysLog where 1=2');
open;
cds_data.First;
while cds_data.eof do
begin
append;
for I := 0 to cds_data.FieldCount-1 do
begin
FieldByName(mfieldName).value:=cds_data.FieldByName(mfieldName).value ;
end;
post;
cds_data.Next;
end;
end;
result:=true;
except
Application.MessageBox('写数据日志时发生错误!','警告信息');
end;
end;
end.