Arsip: Tanya simpan data dari file text ke table

 
user image
more 13 years ago

donlego

ada yang tau ga cara simpan data dari file txt saya pake adotable buat simpan ke file txt pakai misal : adotable.savetofile('test.txt') kalau ngeload pakai : adotable.loadfromfile('test.txt') nah yang jadi pertanyaan gmana caranya menyimpan dari file yg sudah diload tadi ke table. tolong donks :D
user image
more 13 years ago

MrMixer

Tadi katanya kalau ngeload ke Table, syntaxnya tinggal pakai adotable.loadfromfile("test.txt"). Bukannya itu cara buat menyimpan dari file yang sudah diload tadi ke table..?? Terus maksud pertanyaannya apa nih..?? sorry jadi bingung..
user image
more 13 years ago

donlego

maksudnya setelah load dari file txt trus kalau mau didsimpan permanen ke table seperti restore :oops:
user image
more 13 years ago

MrMixer

Wah..!! Tambah bingung nih..!! Mendingan mari kita sama-sama lihat penafsiran "LoadFromFile" asli dari si Borland. TCustomADODataSet.LoadFromFile Loads a recordset from a file. procedure LoadFromFile(const FileName: WideString); 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), 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. Nah Kalau Maksudnya Restore.. berarti table yang akan diisi dari Text File, datanya musti kosong dulu kali ya, biar tidak terjadi duplikasi data.. Mungkin seperti itu bukan..?? :oops:
user image
more 13 years ago

donlego

anybody please help me
user image
more 13 years ago

donlego

yap betul, jadi tabel yang kosong ingin direstore kembali datanya dari file txt tersebut
user image
more 13 years ago

donlego

jadi gmana donk caranya help bangets
user image
more 13 years ago

DelphiExpert

pernah tahu type data BLOB (binary large object)? karena method ADOTable.SaveToFile defaultnya menghasilkan data type binary, maka dikau harus pake field bertipe BLOB cara pemakaiannya: <perasaan udah sering deh dibahas tentang save/load using BLOB stream>

// save to file
ADOTable1.SaveToFile('C:\data1.dat');
// cara load file ke Blob
var BLOB: TBlobField;
begin
  BLOB:= ADOTable1.FieldByName('TheBLOB') as TBlobField;
  ADOTable1.Edit;
  try
    BLOB.LoadFromFile('C:\data1.dat');
    ADOTable1.Post;
  except
    ADOTable1.Cancel;
  end;
more ...
  • Pages:
  • 1
Share to

Random Topic

Local Business Directory, Search Engine Submission & SEO Tools FreeWebSubmission.com SonicRun.com