Tolong pilih kategori sesuai, jenis posting (diskusi atau bukan) dan sertakan tag/topik yang sesuai seperti komputer, java, php, mysql, dll. Promosi atau posting tidak pada tempatnya akan kami hapus!
- Bagi Anda yang ingin mendaftar, baca link berikut:
http://diskusiweb.com/discussion/50491/how-to-registrasi-diskusiweb-com-baca-ini-terlebih-dahulu
- Cara menyisipkan kode program supaya tampil rapi dan terformat dengan baik di diskusiweb.com: http://www.diskusiweb.com/discussion/50415/cara-menyisipkan-kode-program-di-diskusiweb-com
- Cara posting gambar/image di post Anda: http://www.diskusiweb.com/discussion/47345/cara-menyisipkan-menyertakan-image-pada-posting/p1

pliss... kok datanya ga muncul??

slam kenal dulu..

sory, baru gabung dah tanya2, tapi ni penting n btuh jwaban secepatnya

gw dah baca2 post yg da di forum ni, udah gw terapin n gw modif2 dikit. tp kok tetep g mw kluar datanya??
plis, mohon di cek

ni scriptx :

Sub TampilData()
Dim BarisData As Integer
Dim Rs_inventaris As Recordset
Dim rs_inventaris_con As Connection
'On Error Resume Next
MSFlexGrid1.Clear

Grid_Aktif

MSFlexGrid1.Rows = 2
BarisData = 0

Set Rs_inventaris = New ADODB.Recordset
'Rs_inventaris.Open "SELECT * FROM inventaris", rs_inventaris_con, adOpenDynamic, adLockBatchOptimistic

'rs_inventaris_con.Open

Set rs_inventaris_con = New ADODB.Connection
Dim Sqlinventaris As String
Sqlinventaris = "SELECT * FROM inventaris"
Set Rs_inventaris = rs_inventaris_con.Execute(Sqlinventaris)
Rs_inventaris.Open "Sqlinventaris", rs_inventaris_con, adOpenStatic, adLockReadOnly

If Rs_inventaris.BOF Then
Exit Sub
Else
Rs_inventaris.MoveFirst
Do While Not Rs_inventaris.EOF
BarisData = BarisData + 1
MSFlexGrid1.Rows = BarisData + 1
MSFlexGrid1.TextMatrix(BarisData, 0) = BarisData
MSFlexGrid1.TextMatrix(BarisData, 1) = Rs_inventaris!no_invt
MSFlexGrid1.TextMatrix(BarisData, 2) = Rs_inventaris!nm_brg
MSFlexGrid1.TextMatrix(BarisData, 3) = Rs_inventaris!merk
MSFlexGrid1.TextMatrix(BarisData, 4) = Rs_inventaris!Type
MSFlexGrid1.TextMatrix(BarisData, 5) = Rs_inventaris!no_seri
MSFlexGrid1.TextMatrix(BarisData, 6) = Rs_inventaris!warna
MSFlexGrid1.TextMatrix(BarisData, 7) = Rs_inventaris!wil
MSFlexGrid1.TextMatrix(BarisData, 8) = Rs_inventaris!cab
MSFlexGrid1.TextMatrix(BarisData, 9) = Rs_inventaris!divisi
MSFlexGrid1.TextMatrix(BarisData, 10) = Rs_inventaris!pengguna
MSFlexGrid1.TextMatrix(BarisData, 11) = Rs_inventaris!asal
MSFlexGrid1.TextMatrix(BarisData, 12) = Rs_inventaris!tgl
MSFlexGrid1.TextMatrix(BarisData, 13) = Rs_inventaris!harga
MSFlexGrid1.TextMatrix(BarisData, 14) = Rs_inventaris!kondisi

Rs_inventaris.MoveNext

Loop
End If
End Sub


thanx b4

Comments

  • 'rs_inventaris_con.Open

    Hilangkan komentarnya. Karena koneksi belum dibuka
  • Set Rs_inventaris = rs_inventaris_con.Execute(Sqlinventaris)
    Rs_inventaris.Open "Sqlinventaris", rs_inventaris_con, adOpenStatic, adLockReadOnly

    Anda pakai2 metode ya untuk mengkseskusi query? Cukup satu sana
  • Rs_inventaris.Open "Sqlinventaris", rs_inventaris_con, adOpenStatic, adLockReadOnly

    dah di hapus..

    trus yg muncul error "operation is not allowed when the object is closed"

    tu maksudnya apa?
  • Deklrasasikan di modul atau formnya?
  • di form.

    dim rs_inventaris_con as connection
  • dim rs_inventaris_con as New ADODB Connection
  • lumayan, muncul lagi..

    object variable or with blockvariable not set

    apa blum di set?
    tapi di awal han dah di deklarasikan
  • tetep aja,
    masalah utama di catastrophic failure..
  • Coba dilihat pada thread ini,
    Link: http://www.diskusiweb.com/viewthread.php?tid=34288

    Salam, lewat...:cool:
  • koneksi'nya bener ngak... :D
  • hm................
    sebenarnya kalo pake komponen HirarcyFlexGrid
    gag perlu pake LOOPING buat munculin data nya... karena dia mendukung (OLEDB)...

    jd code nya bisa leboh eh lebih sederhana..



    >>

    Sub TampilData()
    Dim BarisData As Integer
    Dim Rs_inventaris As Recordset
    Dim rs_inventaris_con As Connection

    MSFlexGrid1.Clear
    BarisData = 0
    Dim Sqlinventaris As String
    Set Rs_inventaris = New ADODB.Recordset
    Set rs_inventaris_con = New ADODB.Connection


    Sqlinventaris = "SELECT * FROM inventaris"
    Set Rs_inventaris = rs_inventaris_con.Execute(Sqlinventaris)

    If Rs_inventaris.BOF Then
    rs_inventaris.close
    set rs_inventaris=nothing
    Exit Sub
    Else
    set MSFlexGrid1.datasource=rs_inventaris
    end if





    <<<
    nahhhhhhhhhh....

    set MSFlexGrid1.datasource=rs_inventaris

    dengan cara ini kalo ada data,langsung dimasukkan ke GRID..
    tinggal diatur susunan field2 nya pada saat SELECT nya...

    :cool:
Sign In or Register to comment.