Forum Sementara Putera.com

Would you like to react to this message? Create an account in a few clicks or log in to continue.
Forum Sementara Putera.com

Bersama kita perkemaskan forum ini sementara forum asal dalam pemulihan.

Forum putera dah kembali. Masalah sudah berjaya diselesaikan. Sila lawati http://forum.putera.com/tanya


    tolong ajar connect database through vb6.0

    avatar
    edrilKacak
    Ahli Baharu
    Ahli Baharu


    Number of posts : 5
    Registration date : 19/01/2010

    tolong ajar connect database through vb6.0 Empty tolong ajar connect database through vb6.0

    Post by edrilKacak Tue Jan 19, 2010 9:51 pm

    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 Neutral

      Current date/time is Tue May 14, 2024 10:28 pm