我是刚学习用odac连接oracle数据库的,想实现dbf和oracle数据库之间的导入导出功能, 怎么办哟,请各位大侠多多帮忙哈.
解决方案 »
- 用AdoTable是否可以判断出某个字段的类型?
- fastreport2.5的安装问题
- 谜语,想了一个晚上,还是不知道什么意思?
- 一个让我吐血的怪问题,关于控件的Visible属性。
- 一个问题
- 这样的报表效果如何实现:每5行用不同的背景和前景颜色(比如1~5行用白色,6~10行用绿色,11~15行用白色,依次类推)100分求教
- DELPHI问题:如何实现Grid录入时,显示多列下拉列表?(不是LookUp字段方式)
- 用过REPORT MACHINE的前辈请告知数据烂的行距怎样设置,希望窄些
- 关于计算字段的问题?
- 请教高手,Delphi如何通过API管理2000 server 的 FTP 和 IIS 和 DNS?
- 求一sql语句,谢谢各位
- 请教~如何在DBGRID中更改值,但数据库中不发生变化
var
i: Integer;
str: string;
fdr: boolean;
begin
fdr := False;
DataBase2.Close;
CreateAlias('yqcb_dbf', DirectoryListBox1.Directory);
DataBase2.Open;
Gauge1.MaxValue := FileListBox1.SelCount - 1;
for i := 0 to (FileListBox1.Items.Count - 1) do
begin
try
if FileListBox1.Selected[i] then
begin
desfile := FileListBox1.Items.Strings[i];
delete(desfile, 1, 10);
delete(desfile, length(desfile) - 3, 4);
shortName := desfile;
str := copy(FileListBox1.Items.Strings[i], 5, 4) + '-' + copy(FileListBox1.Items.Strings[i], 9, 2) + '-' + '15';
if str <> (fsys_date) then
if MessageDlg('导入表' + #39 + shortName + #39 + '的日期和系统日期不同,是否继续导入', mtConfirmation,
[mbYes, mbNo], 0) = mrYes then continue
else break;
if SQlCount(dataBase1.DatabaseName, 'SELECT TABLENAME FROM CBBDIR WHERE TABLENAME=' + #39 + shortName + #39) = 1 then
begin
Label3.Caption := '正在导入' + ShortName;
Label3.Refresh;
Gauge1.Progress := i;
Impdata(DataBase1.DatabaseName, FileListBox1.Items.Strings[i]);
end;
fdr := True;
end;
except
raise Exception.Create('导入数据失败:');
end;
end;
if fdr = True then
begin
MessageDlg('成功导入数据!', mtInformation, [mbok], 0);
Gauge1.Progress := 0;
end;
end;
var
TmpQuery: Tquery;
i, FileCount: Integer;
str: string;
begin
TmpQuery := TQuery.Create(nil);
DataBase2.Close;
CreateAlias('yqcb_dbf', DirectoryListBox1.Directory);
DataBase2.Open;
str := 'SELECT TABLENAME FROM CBBDIR WHERE SX=''输出表'' AND TABLENAME IS NOT NULL ORDER BY TABLENAME';
TmpQuery.DatabaseName := Database1.DatabaseName;
TmpQuery.SQL.Text := str;
TmpQuery.Open;
FileCount := TmpQuery.RecordCount;
Gauge1.MaxValue := FileCount - 1;
for i := 0 to FileCount - 1 do
begin
Label3.Caption := '正在导出' + TmpQuery.Fields[0].AsString;
Panel1.Refresh;
Gauge1.Progress := i;
bm(TmpQuery.Fields[0].AsString); //batchMove
TmpQuery.Next;
end;
MessageBox(handle, '成功导出数据!', '系统信息', mb_ok);
Gauge1.Progress := 0;
Label3.Caption := '';
TmpQuery.Free;
end;