易
易名烦
Unregistered / Unconfirmed
GUEST, unregistred user!
screen.Cursor:=crhourglass;
tablesource.DisableControls;
OUTDBFTAB.Close;
OUTDBFTAB.DatabaseName:=EXTRACTFILEPATH(FILENAME);
OUTDBFTAB.TableName:=EXTRACTFILENAME(FILENAME);
OUTDBFTAB.TABLETYPE:=TTFOXPRO;
OUTDBFTAB.FieldDefs:=TABLESOURCE.FieldDefs;
OUTDBFTAB.CreateTable;
OUTDBFTAB.Open;
TABLESOURCE.First;
WHILE NOT TABLESOURCE.Eof DO
BEGIN
APPLICATION.ProcessMessages;
OUTDBFTAB.Append;
FOR I:=0 TO TABLESOURCE.FieldCount-1 DO
OUTDBFTAB.Fields.Value:=OUTDBFTAB.Fields.Value;
OUTDBFTAB.Post;
TABLESOURCE.Next;
END;
outdbftab.Close;
MESSAGEBOX(HANDLE,PCHAR('数据成功导入到:'+FILENAME),'成功导出',MB_OK+MB_ICONINFORMATION);
screen.Cursor:=crdefault;
tablesource.EnableControls;
EXCEPT
MESSAGEBOX(HANDLE,PCHAR('数据导出错误!'),'提示',MB_OK+MB_ICONERROR);
screen.Cursor:=crdefault;
tablesource.EnableControls;
END;
tablesource.DisableControls;
OUTDBFTAB.Close;
OUTDBFTAB.DatabaseName:=EXTRACTFILEPATH(FILENAME);
OUTDBFTAB.TableName:=EXTRACTFILENAME(FILENAME);
OUTDBFTAB.TABLETYPE:=TTFOXPRO;
OUTDBFTAB.FieldDefs:=TABLESOURCE.FieldDefs;
OUTDBFTAB.CreateTable;
OUTDBFTAB.Open;
TABLESOURCE.First;
WHILE NOT TABLESOURCE.Eof DO
BEGIN
APPLICATION.ProcessMessages;
OUTDBFTAB.Append;
FOR I:=0 TO TABLESOURCE.FieldCount-1 DO
OUTDBFTAB.Fields.Value:=OUTDBFTAB.Fields.Value;
OUTDBFTAB.Post;
TABLESOURCE.Next;
END;
outdbftab.Close;
MESSAGEBOX(HANDLE,PCHAR('数据成功导入到:'+FILENAME),'成功导出',MB_OK+MB_ICONINFORMATION);
screen.Cursor:=crdefault;
tablesource.EnableControls;
EXCEPT
MESSAGEBOX(HANDLE,PCHAR('数据导出错误!'),'提示',MB_OK+MB_ICONERROR);
screen.Cursor:=crdefault;
tablesource.EnableControls;
END;