Tukang Online
 
Blognya Orang Djember, Semoga Bermanfaat.....


Monday, January 4, 2010

kedua

HARI KEDUA AKU PRAKERIN
hari ini aku membuat program login untuk laporan nanti dengan vb 6.0
script sederhananya kayak gini ...

Dim rs As Recordset

Private Sub Command1_Click()
Set rs = New Recordset
rs.Open " select * from login where password ='" & Text1.Text & "'", db, adOpenStatic, adLockOptimistic
If rs.EOF Then
MsgBox "---Masukkan password anda dengan benar---", vbExclamation + vbCritical, "warning"
Text1.Text = ""
Text1.SetFocus
Else
Form2.Show
Me.Hide
End If
End Sub

Private Sub Command2_Click()
End
End Sub

Private Sub Form_Load()

Call koneksi

End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Command1_Click
End If
End Sub

dan di dalam modulex......

Public db As Connection

Sub koneksi()

Set db = New Connection
db.CursorLocation = adUseClient
db.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\siswa prakerin\vb\buat laporan\db_barang.mdb;Persist Security Info=False"

End Sub

yo' opo........?!!!

0 comments:

Post a Comment

Gabung Dunkz

Daftar Isi Blog


Anda adalah pengunjung ke :

Counter Powered by  RedCounter