edrilKacak 0 Report post Posted January 19, 2010 salam to everybodynak mintak tolong,aku nie beginer dalam dunia programming.aku ade buat program mudah guna vb6.0bru nak siapkan form untuk login,kalu orang tu masuk password betol n id ,baru dapat bukak second form.kat bawah nie coding yg tak siap ak buat.stakat nie aku just controll cek pasword and id tak boleh kosong.lau kosong,kuar msg errorskang nie aku nak test grab data dr database,aku dah create table kat access2003 table tu,namenye mydatabase kat desktop. ade dua column user id n pasword,tp masalh nye, aku tak tau camne nak connect vb6.0 ke database nie,Untuk pengetahuan korang aku ade cuba setup ODBC kat administrative tool then kat system DSN ,dah ade aku set as myconnection.cube ko tengok kat administrativetool-->datasourceODBC-->system DSN-->look in --> data source,aku create connection bernama myconnection.kat sini lah.betol x aku buat?so far dah berjaye,tp skang aku tak tau camne nak buat after that,korang tolong tunjukkan aku leh kat mane tempat nak write coding untuk bukak connection tu,so bile orang masukk kan user id and password,boleh la program aku cek kat database .So kat mane nak tulis code tu?n ape syntax die?kat module ke?ke kat form tu seniri.Private Sub Command1_Click()If Me.Command1 = True Then 'function ni lau user click,sepatutnya If txtPwd.Text <> "" And txtId.Text <> "" Then die cek dulu password and id betol ke x. mycalendar.Show lau tak,mycalendar tak boleh bukak. home.Hide End IfEnd IfEnd SubPrivate Sub txtId_KeyPress(KeyAscii As Integer)If KeyAscii = 13 Then If Me.txtPwd <> "" Then 'MsgBox "good" Else MsgBox "password cannot be blanks" End If End IfEnd SubPrivate Sub txtPwd_KeyPress(KeyAscii As Integer)If KeyAscii = 13 Then If Me.txtId <> "" Then 'do something here Else MsgBox "user Id cannot be blanks" End IfEnd IfEnd Sub ::icon_neutral:: Quote Share this post Link to post Share on other sites