Contoh Query yang menampilkan data di TDBGrid

ini saya buat contoh menampilkan data di komponen true dbgrid,
komponen tambahan di visual basic 6.0 :
TDBGrid2.MoveFirst
  N = 0
  m = 0
  For N = 0 To vaGrid2.UpperBound(1)
    nJumlah = 0
    Set ADOINDRA1 = New ADODB.Recordset

    SQL = " Select COUNT(FDTKD_PRODUK) AS JUMLAH FROM TRANSAKSIPASIEN
    WHERE FDTKD_PRODUK = '" & TDBGrid2.Columns(3).Text & "'
    AND FDTTGL_TRANSAKSI >='" & dTgl1.Value & "'
    AND FDTTGL_TRANSAKSI  <= '" & dTgl2.Value & "' "
    ADOINDRA1.Open SQL, DbCon, adOpenStatic, adLockReadOnly
    For m = 1 To ADOINDRA1.RecordCount
      nJumlah = nJumlah + ADOINDRA1!jumlah
      ADOINDRA1.MoveNext
    Next m
    TDBGrid2.Columns(2).Value = nJumlah
    TDBGrid2.MoveNext
    nJumlah2 = nJumlah2 + nJumlah
    TDBGrid2.Columns(2).FooterText = Format(nJumlah2, "###,###,##0")
  Next N
  TDBGrid2.Refresh

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s