table77.Close;
table77.DatabaseName := '\SysPro\_Rtxt\';
if directoryexists( 'c:\temp\' ) then
table77.DatabaseName := 'c:\temp\' ;
if directoryexists( 'c:\temp\syspro\' ) then
table77.DatabaseName := 'c:\temp\syspro\' ;
//pomast.orddate, pomast.pono, pomast.vendclass, pomast.vendorid, ');
table77.TableType := ttParadox;
table77.TableName := xfile2;
table77.FieldDefs.Clear;
table77.FieldDefs.Add('PoNo', ftstring, 8, False);
table77.FieldDefs.Add('Orddate', ftdate, 0, False);
table77.FieldDefs.Add('VendClass', ftstring, 4, False);
table77.FieldDefs.Add('VendorID', ftstring, 8, False);
table77.IndexDefs.clear;
table77.IndexDefs.add ('','pono',[ixPrimary]);
//table77.IndexDefs.add ('idex01','bluePRT',[ixCaseInsensitive]);
table77.CreateTable;
table77.Active := true ;
Copy or Append from other table
with delphi command function :
BatchMove1.Destination := table77 ;
BatchMove1.Source := table1;
BatchMove1.mappings.clear;
BatchMove1.Mappings.Add('PoNo=PoNo');
BatchMove1.Mappings.Add('OrdDate=OrdDate');
BatchMove1.Mappings.Add('VendClass=VendClass');
BatchMove1.Mappings.Add('VendorId=VendorId');
//BatchMove1.Mode := batcopy ; //copy table biasa
BatchMove1.Mode := batAppend ; //append table
//showmessage ( batchmove1.mappings.Text+'<<<' ) ;
BatchMove1.execute;
mungkin aja di bisa di bantu
Telp 62 813.1401.3305
/ 62 817. 910.8005
Thursday, 19 June 2008
Create Table By Delphi Programe
Posted by delvin at 22:12 0 comments
Labels: Command Function
Sample of Function Delphi
d = Decimal (integer)
e = Scientific
f = Fixed
g = General
m = Money
n = Number (floating)
p = Pointer
s = String
u = Unsigned decimal
x = Hexadecimal
Sample of Program format function
var
text : string;
begin
// Just 1 data item
ShowMessage(Format('%s', ['Hello']));
// A mix of literal text and a data item
ShowMessage(Format('String = %s', ['Hello']));
ShowMessage( ' ' );
// Examples of each of the data types
ShowMessage(Format('Decimal = %d', [-123]));
ShowMessage(Format('Exponent = %e', [12345.678]));
ShowMessage(Format('Fixed = %f', [12345.678]));
ShowMessage(Format('General = %g', [12345.678]));
ShowMessage(Format('Number = %n', [12345.678]));
ShowMessage(Format('Money = %m', [12345.678]));
ShowMessage(Format('Pointer = %p', [addr(text)]));
ShowMessage(Format('String = %s', ['Hello']));
ShowMessage(Format('Unsigned decimal = %u', [123]));
ShowMessage(Format('Hexadecimal = %x', [140]));
end;
Result Show :
Hello
String = Hello
Decimal = -123
Exponent = 1.23456780000000E+004
Fixed = 12345.68
General = 12345.678
Number = 12,345,68
Money = ?12,345.68
Pointer = 0069FC90
String = Hello
Unsigned decimal = 123
Hexadecimal = 8C
Cari Uang Dari Internet
Sample of function delphi
Delphi file manipulation
Put your file on line free
Posted by delvin at 22:08 1 comments
Labels: Command Function
Tuesday, 15 January 2008
Delphi file manipulation
You can make forlder, remane forlder, delete forlder, checking folder by delphi command
File function in delphi :
- checking file is exist or not :
if FileExists( 'test.xls' )=false then
showmessage ( "this file is not exist" ) ; - checking folder is exist or not :
if directoryexists( xIsFolder ) then
showmessage ( "this folder is not exist" ) ; - Close windows or program :
var
x6h : hwnd;
begin
x6h := findwindow(nil,"google - microsoft internet explorer"); // check windows / ie
if x6h<>0 then postmessage ( x6h,wm_close,1,0); // close windows / ie
end; - Delete file :
sysutils.deletefile ( pchar('coba.xls') ) ; - Rename file :
renamefile ( 'c:\temp\test1.XLS', 'c:\temp\test77.XLS' ); - Openning file :
first add in uses
uses
Windows, Messag . . . . . . . . . . . . . . . . . . , Dialogs, StdCtrls,
shellapi ;
begin
shellexecute (handle,'open',pchar( 'c:\temp\text44.txt' ),nil,nil,sw_show) ;
end;
- To know the current drive in delphi :
showmessage ( 'the current drive is ' + GetCurrentDir ) ;
Posted by yennita at 17:59 0 comments







