Jump to content
Sign in to follow this  
Own

Visual Basic 6.0 & Ms Access

Recommended Posts

Akum wbt…

den wat system(Hotel Registration System) gune VB 6.0 utk diernye interface and Ms Access 2000 utk pangkalan data.

ade form utk insert info.

Cthnye; borang utk masukkan rekod baru utk sebuah bilik(jenis Deluxe).

Den dah create diernye dbase. Nama db tu Deluxe.mdb

Sekarang nih dah boleh view record, maksudnye leh display rekod Pertama, Berikut(Next), Akhir(Last) dan Sebelum(Previous). biggrin.gif Nak Tambah(Add), Simpan(Save), Hapus(Delete) dan Batal(Cancel) pun kire dah boleh la(tapi ader sket masalah lagi)… dry.gif

Tapi, yang nak tau sekarang nie, nak wat editnye code canner ek…? huh.gif Dah cari,..ader jumpa 2-3 source code. Dah cube tapi ader error. sad.gif Den guna Adodc biggrin.gif

that's all for now. sesaper yg boleh tulun tu, tulunlah yer... tq... biggrin.gif

Edited by Own

Share this post


Link to post
Share on other sites

aaa..kalo gune datagrid, leh edit data terus x salah aku..tapi, lebih mudah kalo pakai adodb..cume koding banyak skit..

Share this post


Link to post
Share on other sites

coding dia lebih kurang save jugak....

cth:

"SELECT * frm tblape2jelah WHERE user_id='" & txtUserID.text & "'"

pastu display sume data dlm table kt dlm textbox(s) yg sesuai... kalu nak edit.. edit pastuh save balik...

ape aku tulis pon aku xpaham..pasal terus terang aku cakap,aku xsuka & dah xigt dah pon nak buat sume nih pakai adodc tongue.giftongue.gif

Share this post


Link to post
Share on other sites

aaa..kalo gune datagrid, leh edit data terus x salah aku..tapi, lebih mudah kalo pakai adodb..cume koding banyak skit..

erm..adodb tu yang kalu kite guna OLE tu eh? rolleyes.gif

hehe..sorry..den x penah lagi gune OLE tu.. tongue.gif

yg eden dapat tau nie pun setelah tanye En Google biggrin.gif dan den tengok mmg byk koding.. rolleyes.gif

thanks nagakeciks

Share this post


Link to post
Share on other sites

wokey! den try wat dlu, ader paper, den tanye lagi... biggrin.gif

thanks Armster..

Share this post


Link to post
Share on other sites

erm..adodb tu yang kalu kite guna OLE tu eh? rolleyes.gif

hehe..sorry..den x penah lagi gune OLE tu.. tongue.gif

yg eden dapat tau nie pun setelah tanye En Google biggrin.gif dan den tengok mmg byk koding.. rolleyes.gif

thanks nagakeciks

OLE OLE..

Hehe..

ADODC - > Component

ADODB - > Reference

ADODC -> Mudah n Cepat , Koding Yang Sikit , Kurang Kawalan Terhadap Data

ADODB -> Lebih Kawalan Data , Koding Yang Banyak

Share this post


Link to post
Share on other sites

own... kalau aku ada masa (hari nih) aku post coding utk connect database pakai adodb... doakan bos aku xkacau aku ari nih hahaha

Share this post


Link to post
Share on other sites

wokeh, thanks... biggrin.gif

den baru jer lepas meeting pasal system nih. adusss tensennye...banyak lak bende yang dier nak huh.gif poning palo den blink.gif

erm..banyak bende den nak tanye lagi nih sbnnye... rolleyes.gif nantilah ek

Share this post


Link to post
Share on other sites

wooyooo ramai giloss nak ..

sabarr.. aku buat evaluation jerrr,,

hehehehe..

nak source code ker nak exe jerr...

tapi buat kat .net laaa..

database aku guna mysql..

lagi apa yer.. reporting tool aku guna crystal report...

oo kalau jual kayooo pakcikkk..

hahahahah

kay sini patut ada bahagian source code aa..

baik wujudkan satu part utk source code jer.. and then leh aa sapa2 letak source code katt situ.. amacam putera.com...

Share this post


Link to post
Share on other sites

A'kum...

den ado masalah nih.. huh.gif

With Data1

.Refresh

.Recordset.MoveFirst

Do Until .Recordset.EOF

->For i = 0 To 3     

Combo1.List(i) = .Recordset.Fields(0) 

.Recordset.MoveNext   

->Next i     

Loop       

End With

bila den run benda nie,

1. kalu x buang 2 line nie(->), dier listkan 4 nama kat comboBox tu (& dier ada 4 record dlm db)

2. kalu buang 2 nie, dier listkan 1 jer nama.

3. kalu tambah rec manually kat access, masa run vb ada error.

mcmana nk dier listkan semua rec?

sesaper leh tolong? ohmy.gif

t.kasih smile.gif

Share this post


Link to post
Share on other sites

saya pun nak minta tolong gak biggrin.gif baru beljar jugak ni.

Saya download contoh program tentang MSFlexgrid yang boleh sambung kat access gak.

Saya ikut lah dia punya koding semua , tapi bila run ada error, yang asal nyer boleh run pulak blink.gif

dah include kan libry ADO , Jet lah, hampir semua libry & option saya tick laugh.gif tapi tak leh.

Ada tertinggal apa-apa tak. Bismillah pun dah baca laugh.gif

Share this post


Link to post
Share on other sites

didi7eleven, dah check reference?

own:

sori aku xperasan, sibuk main darkthrone la plak hehehe

ko nak buat mcm ni kan:-

1. list semua data dlm combo box

2. bila tambah data baru, data dlm combo box pon tambah..

betul?

kalau mcm tu, lepas proses tambah add new data tu.. clear kan sume data dlm combo box, pastu add balik data.. pandai2 la adjust coding, takut ada redundant

Share this post


Link to post
Share on other sites

own:

sori aku xperasan, sibuk main darkthrone la plak hehehe

ko nak buat mcm ni kan:-

1. list semua data dlm combo box

2. bila tambah data baru, data dlm combo box pon tambah..

betul?

ya betuulll...! hehe..

list yg akan keluar kat combo box tu adalah nama pengguna sistem. so, masa run, bila klik kat combo box tu, senarai semua nama pengguna akan kuar

kalau mcm tu, lepas proses tambah add new data tu.. clear kan sume data dlm combo box, pastu add balik data.. pandai2 la adjust coding, takut ada redundant
ok, thanks! den cuba dlu...

Share this post


Link to post
Share on other sites

den nak paparkan status bilik ikut no.bilik. bila klik kat no bilik tu, bilik yg statusnya ‘available’,/’kiv’/’rosak’, akan kuar no bilik, status dan jenis jer. bilik yg ‘sedang digunakan’ akan kuar maklumat bilik(no bilik, status,dll), maklumat pelanggan(nama, no tel, alamat dll) dan maklumat checkin(tarikh checkin). seme dari 3 table db yang berbeza(bilik, pelanggan & checkin). so den wat query ‘statusBlk’ dan wat coding camnie…

Private Sub List1_Click()

With Data1

.RecordSource = "select * from statusBlk"

.Refresh

.Recordset.MoveFirst

Do Until .Recordset.EOF

If .Recordset.Fields(0) = List1.Text And .Recordset.Fields(7).Value <> "Sedang digunakan" = False Then

Label1.Caption = .Recordset.Fields(0)

Label2.Caption = ""

Label3.Caption = ""

Label4.Caption = ""

Label5.Caption = ""

Label6.Caption = ""

Label7.Caption = ""

Label8.Caption = .Recordset.Fields(7)

Label11.Caption = .Recordset.Fields(8)

Exit Sub

Else

.Recordset.MoveNext

End If

Loop

If .Recordset.Fields(0) = List1.Text Then

Label1.Caption = .Recordset.Fields(0)

Label2.Caption = .Recordset.Fields(1)

Label3.Caption = .Recordset.Fields(2)

Label4.Caption = .Recordset.Fields(3)

Label5.Caption = .Recordset.Fields(4)

Label6.Caption = .Recordset.Fields(5)

Label7.Caption = .Recordset.Fields(6)

Label8.Caption = .Recordset.Fields(7)

Label11.Caption = .Recordset.Fields(8)

End If

End With

End Sub

output dier kuar :

- bila klik kat no bilik, bilik yg statusnye(.Recordset.Fields(7)) ‘Sedang digunakan’ jer yg kuar. dan dier display kat Label1(no bilik), Label8(status) & Label11(jenis) jer

- kalu klik kat bilik yg status dier lain dari ‘Sedang digunakan’, nanti dia kuar error msg ‘no current record’

naper eh? salah kat diernye condition ke? huh.gif

kalu nk guna byk table sekaligus canner sbnye? rolleyes.gif

tq smile.gif

Share this post


Link to post
Share on other sites

If .Recordset.Fields(0) = List1.Text And .Recordset.Fields(7).Value <> "Sedang digunakan" = False Then
ape ni? if statement salah daa patutnya buat mcm ni..
If .Recordset.Fields(0) = List1.Text then
if .Recordset.Fields(7).Value <> "Sedang digunakan" then
'masuk coding utk rosak/available
else
'masuk coding utk sdg digunakan
end if
end if

kalu xsilap laa... just main buat je ni

p/s: lain kali bg laa nama kat mende2 tu sume.. xde laa pening org nak tgk..

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...