如何將 Table 存成 *.txt 檔....... |
|
33403340
一般會員 發表:3 回覆:1 積分:0 註冊:2006-10-19 發送簡訊給我 |
|
CoffeeX
中階會員 發表:18 回覆:121 積分:72 註冊:2005-02-18 發送簡訊給我 |
|
Coffee
版主 發表:31 回覆:878 積分:561 註冊:2006-11-15 發送簡訊給我 |
Help 應該很好用吧?
Loads a recordset from a file. Delphi syntax: procedure LoadFromFile(const FileName: WideString); C syntax: void __fastcall LoadFromFile(const WideString FileName); Description Call LoadFromFile to load the recordset for the calling ADO dataset component from a file. If the loading operation fails, the current recordset is neutralized (set to nil (Delphi) or NULL (C )), the dataset component remains inactive, and an EOleException exception is raised. If the attempt to load data from a file is successful, the ADO dataset component is automatically activated and the data made available. FileName is a string containing the name of the file. LoadFromFile closes the dataset component before loading the recordset from the file specified in FileName. Saves a recordset to a file. Delphi syntax: procedure SaveToFile(const FileName: String = ''; Format: TPersistFormat = pfADTG); C syntax: void __fastcall SaveToFile(const WideString FileName = L"", TPersistFormat Format = pfADTG); Description Call SaveToFile to save the current recordset to a file. If the destination file already exists, it is overwritten. FileName is a string containing the name of the destination file. This file remains open from the first call to SaveToFile until the dataset is closed. This file can be read by other applications while it is open, but they cannot write to the file. Format specifies the file format for the saved recordset. By default, Format is pfADTG (Advanced Data TableGram format). Note: Microsoft recommends using a client-side cursor (the dataset is opened with a CursorLocation property value of clUseClient). This way, if the provider used does not support saving the recordset the client cursor will provide the necessary functionality.
------
不論是否我發的文,在能力範圍皆很樂意為大家回答問題。 為了補我的能力不足之處,以及讓答案可以被重複的使用,希望大家能儘量以公開的方式問問題。 在引述到我的文時自然會儘量替各位想辦法,謝謝大家! |
sdddds
一般會員 發表:10 回覆:9 積分:3 註冊:2003-05-17 發送簡訊給我 |
你也可以用TMemoryStream試試
TMemoryStream *IO_file=new TMemoryStream(); IO_file->WriteBuffer(Data,length); IO_file->SaveToFile("temp.txt"); delete IO_file; /* 定義IO_file並new一個TMemoryStream() 將資料寫入TMemoryStream的WriteBuffer並給他資料及長度 將IO_file內的資料存入temp.txt 最後在釋放你new出來的TMemoryStream */ |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |