怎样将远程Oracle中的table导出到本地的dbf? |
尚未結案
|
liangzai
初階會員 發表:77 回覆:91 積分:33 註冊:2004-08-13 發送簡訊給我 |
|
kgt
高階會員 發表:17 回覆:308 積分:165 註冊:2002-03-13 發送簡訊給我 |
|
tonytop
中階會員 發表:6 回覆:114 積分:89 註冊:2003-12-04 發送簡訊給我 |
可以用DbiCopyTable這個指令達成,請看以下範例,之前改寫過oracle轉dbf是可行的,加油吧!
Copy/ delete a BDE table
From: "David S. Becker"
Here is an example of a routine that I use for copying and deleting tables. It uses DB, DBTables, DbiProcs,DbiErrs, and DbiTypes.
You simply provide the directory to copy from, the source table name, the directory to copy to, and the destination table name, and the BDE will copy the entire table, indexes and all to the new file.
The delete function takes the path to delete from and the name of the table to delete, the BDE takes care of deleting all associated files (indexes, etc.).
These procedures have been pulled off a form of mine, and I've edited them to remove some dependencies that existed with that form. They should now be completely stand-alone.
procedure TConvertForm.CopyTable(FromDir, SrcTblName, ToDir, DestTblName: String); var DBHandle: HDBIDB; ResultCode: DBIResult; Src, Dest, Err: Array[0..255] of Char; SrcTbl, DestTbl: TTable; begin SrcTbl := TTable.Create(Application); DestTbl := TTable.Create(Application); try SrcTbl.DatabaseName := FromDir; SrcTbl.TableName := SrcTblName; SrcTbl.Open; DBHandle := SrcTbl.DBHandle; SrcTbl.Close; ResultCode := DbiCopyTable(DBHandle,false, StrPCopy(Src,FromDir '\' SrcTblName), nil, StrPCopy(Dest,ToDir '\' DestTblName)); if ResultCode <> DBIERR_NONE then begin DbiGetErrorString(ResultCode,Err); raise EDatabaseError.Create('While copying ' FromDir '\' SrcTblName ' to ' ToDir '\' DestTblName ', the ' ' database engine generated the error ''' StrPas(Err) ''''); end; finally SrcTbl.Free; DestTbl.Free; end; end<[忙盲茫]> ☆俺要升級啊☆ |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |