Jump to content
Sign in to follow this  
edrilKacak

tolong ajar connect database through vb6.0

Recommended Posts

salam to everybody

nak mintak tolong,aku nie beginer dalam dunia programming.

aku ade buat program mudah guna vb6.0
bru 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 error

skang 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 If
End If
End Sub


Private 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 If

End Sub

Private 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 If
End If
End Sub ::icon_neutral::

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...