Arsip: Tanya simpan data dari file text ke table

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

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..

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

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:

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

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
reply |
Report Obsolete
Last Articles
- Project Group dalam Lazarus
- FastPlaz Database Explorer
- Release: FastPlaz Super Mom v0.12.22
- PascalClass #3: Web Development with Free Pascal
- Makna Pascal di Pascal Indonesia
- Kulgram : Instalasi Lazarus di Perangkat Berbasis ARM
- PascalClass #1: Analisa Database dan Machine Learning
- PascalTalk #6: (Podcast) Kuliah IT di luar negeri, susah gak sih?
- Mengenal OXYGENE – Pascal For .NET
- PascalTalk #5: UX: Research, Design and Engineer
Last Topic
- PascalTalk #6: (Podcast) Kuliah IT di luar negeri, susah gak sih?
by LuriDarmawan in Tutorial & Community Project more 4 months ago - PascalTalk #5: UX: Research, Design and Engineer
by LuriDarmawan in Tutorial & Community Project more 5 months ago - PascalTalk #4: Obrolan Ringan Seputar IT
by LuriDarmawan in Tutorial & Community Project more 5 months ago - PascalTalk #2: Membuat Sendiri SMART HOME
by LuriDarmawan in Tutorial & Community Project more 5 months ago - PascalTalk #3: RADically Fast and Easy Mobile Apps Development with Delphi
by LuriDarmawan in Tutorial & Community Project more 5 months ago - PascalTalk #1: Pemanfaatan Artificial Intelligence di Masa Covid-19
by LuriDarmawan in Tutorial & Community Project more 5 months ago - Tempat Latihan Posting
by LuriDarmawan in OOT more 1 years ago - Archive
- Looping lagi...
by idhiel in Hal umum tentang Pascal Indonesia more 8 years ago - [ask] koneksi ke ODBC user Dsn saat runtime dengan ado
by halimanh in FireBird more 8 years ago - Validasi menggunakan data tanggal
by mas_kofa in Hal umum tentang Pascal Indonesia more 8 years ago
Random Topic
- Memanggil Project dalam Project Gorup
by nholik1205 in Network, Files, I/O & System more 13 years ago - Bagaimana Login dengan User Dari MySQL
by jainul in MySQL more 9 years ago - tolong di bantu, program testing RFID
by alisiana in Lain-lain more 8 years ago - Help .. Terjemahin in delphi Dunk ...
by daryl_sukma_gumilar in Hal umum tentang Pascal Indonesia more 11 years ago - delphi untuk pocket PC
by ImanD in Games more 15 years ago - Safely remove hardware
by xbox in Network, Files, I/O & System more 14 years ago - pencet keyboard
by unknown in Network, Files, I/O & System more 12 years ago - Tny error ttg image!!!
by camp_sire in Tip n Trik Pemrograman more 12 years ago - Rave Bundle Delphi 7 Problem
by dilphio7 in Reporting more 12 years ago - Input DateTimePicker ke Db Paradok?
by adit4it in Hal umum tentang Pascal Indonesia more 14 years ago