*** DESIGN TIME ***

Gunakan komponen TADOStoredProc. Set Property:
- Connection    -> ADOConnection yg tersedia
- ProcedureName -> Pilih 'sp_insertkode'
- Parameters:
  * u/ kode => DataType  = ftString
               Size      = 15
               Direction = pdInput
               Value     = ...(nilai u/ kode)...
  * u/ nama => DataType  = ftString
               Size      = 25
               Direction = pdInput
               Value     = ...(nilai u/ nama)...

Di dalam program, cara mengeksekusinya:

ADOStoredProc1.ExecProc;

*** RUN-TIME ***

var SP : TADOStoredProc;
begin
  SP:=TADOStoredProc.Create(Self);
  try
    SP.Connection   :=ADOConnection1;
    SP.ProcedureName:='sp_insertkode';

    with SP.Parameters.AddParameter do    // @kode
    begin
      DataType :=ftString;
      Size     :=15;
      Direction:=pdInput;
      Value    := ...(nilai @kode)...
    end;

    with SP.Parameters.AddParameter do    // @nama
    begin
      DataType :=ftString;
      Size     :=25;
      Direction:=pdInput;
      Value    := ...(nilai @nama)...
    end;

    SP.ExecProc;

  finally
    SP.Free;
  end;

*** CARA LAIN MENGGUNAKAN ADOQUERY ***

Sebenarnya bisa juga menggunakan komponen TADOQuery:
- Set property Connection
- Set property SQL:
    'EXEC sp_insertkode 99 ''Nama Barang'''
    99 adalah kode, Nama Barang adalah field Nama

Pada program, jangan gunakan perintah OPEN melainkan EXECSQL:
  ADOQuery1.ExecSQL;




------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get 128 Bit SSL Encryption!
http://us.click.yahoo.com/LIgTpC/vN2EAA/xGHJAA/i7folB/TM
---------------------------------------------------------------------~->

Berlangganan: [EMAIL PROTECTED]
Stop Berlangganan: [EMAIL PROTECTED]
Keluhan Milis(Unbouncing,spam,dll): [EMAIL PROTECTED] 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 


Kirim email ke