Arsip: Backup Data Tabel Paradox


by doditali in Articles more 15 years ago 1561
Source berikut ini untuk membackup data (PARADOX) beserta isi-isinya.
kalo nggak mo jalan programnya coba tambahkan
uses DB, DBTables, DBIProcs

petikan kode-nya:
procedure copyTable( const strSource, strTarget : String );
var
hDB             : HDBIDB;     // Handle ke database
const
OVERWRITE_FLAG = Bool( TRUE );
begin
with TTable.Create( Application ) do
try
DatabaseName  := extractFilePath( strSource );
TableName     := extractFileName( strSource );
open;
hDB           := DBHandle;
close;
// buat backup
check( dbiCopyTable( hDB, OVERWRITE_FLAG,
pChar( strSource ), 'PARADOX',
pChar( strTarget ) ) );
finally
free;
end;
end;

untuk memanggil procedure copytable, gunakan komponen apa aja saya pake komponen button
procedure TForm1.Button1Click(Sender: TObject);
begin
copyTable( 'C:\Program Files\Common Files\Borland Shared\Data\Country.db',
'C:\My Documents\Table\Pindahan.db' );
// buatkan dulu directory C:\My Documents\Table
end;

Silahkan mencoba.

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