不要用表,像Excel的可不可以?
解决方案 »
- 如何在DBChart的SERIES上根据鼠标移动动态显示坐标值
- 如何判定窗体的鼠标是否活动,或无输入状态.本人想做个自动关闭程序,比如隔了10分钟后,判断后,鼠标无活动后,就关闭程序.先谢谢了
- 本人是新手,刚学Delphi和SQL语言,现有以下问题想请教大家!
- 关于PASCAL问题?
- 请问对调用.db数据库的程序打包时,怎样加入BDE啊?
- 关于ToolBar问题?
- Delphi ADO 连接 Excel 2010
- 如何得到一个存储过程的反回值?
- 添加一条新记录,post没问题,但post后,用adoquery.edit对改记录进行编辑,却不能post,出现下列信息:
- 求书
- 请各位delphi专家帮帮我
- ToolButton的问题?
用时再从txt中读出,不就OK了
能举个例了吗?
FileName:TFileName;
iFileHandle:Integer;
Strop_id,Strop_type,Strop_table,Strop_man,Strop_date:Variant; i,j,k:integer;
iLen:array[0..4] of Integer; iLenField:array[0..4] of integer;
F: TextFile;
strTmp:string;
begin
if query3.active= true then
begin
Strop_id:= ' 日志编号';
Strop_type:= '日志创建类型';
Strop_table:= '日志创建表';
Strop_man:= '日志创建员工';
Strop_date:='日志创建日期'; iLen[0]:=18;
iLen[1]:=18;
iLen[2]:=20;
iLen[3]:=20;
iLen[4]:=20; for j:=0 to 4 do
for i:=0 to iLen[j]-10 do
begin
if j=0 then Strop_id:=Strop_id+' ';
if j=1 then Strop_type:=Strop_type+' ';
if j=2 then Strop_table:= Strop_table+' ';
if j=3 then Strop_man:=Strop_man+' ';
if j=4 then Strop_date:= Strop_date+' ';
end; strTmp:=Strop_id+Strop_type+Strop_table+Strop_man+ Strop_date; SaveDialog1.Execute;
FileName:=SaveDialog1.FileName+'.TXT';
iFileHandle:=FileCreate(FileName);
if iFileHandle<=0 then
begin
application.Messagebox(pchar('创建文件失败!'),'提示',mb_ok);
exit;
end;
FileClose(iFileHandle);
AssignFile(F,FileName); ReWrite(F);
Writeln(F,strTmp); for i:=0 to Query3.RecordCount-1 do
begin
Strop_id:=Query3['op_id'];
if Strop_id=Null THEN Strop_id:=' '; Strop_type:=Query3['op_type'];
if Strop_type=NULL THEN Strop_type:=' '; Strop_table:=Query3['op_table'];
if Strop_table=null then Strop_table:=' '; strop_man:=Query3['op_man'];;
if strop_man=NULL THEN Strop_man:=' '; Strop_Date:=Query3['op_Date'];;
if Strop_Date=null then Strop_Date:=' '
else Strop_Date:=DateTimeToStr(Strop_Date);
iLenField[0]:=Length(strop_id);
iLenField[1]:=Length( Strop_type);
iLenField[2]:=Length( Strop_table);
iLenField[3]:=Length(strop_man);
iLenField[4]:=Length( Strop_Date);
for j:=0 to 4 do
for k:=0 to iLen[j]-iLenField[j]+1 do
begin
if j=0 then strop_id:=strop_id+' ';
if j=1 then Strop_type:=Strop_type+' ';
if j=2 then Strop_table:=Strop_table+' ';
if j=3 then strop_man:=strop_man+' ';
if j=4 then Strop_Date:=Strop_Date+' ';
end; strTmp:=strop_id+Strop_type+Strop_table+strop_man+Strop_Date;
Writeln(F,strTmp);
query3.next; end; closeFile(F);
end;
end;