|
|
|
Pembuatan login di Visual Basic 6
|
2007/01/01 09:20
|
|
|
Drag 2 komponen label,2 komponen textbox dan 1 komponen commandbutton
dengan propertinya sebagai berikut :
komponen caption/text password char align
Label1 Nama User
Label2 Password
textbox1 "kosongkan" center
textbox2 "kosongkan" * center
commandbutton1 OK
Anda harus membuat sebuah database dahulu dengan nama "word.mdb",tabel sebagai berikut
properti text
user text 20 (Primary key)
pass text 10
simpan tabel dengan nama log
gw anggap kalian dah bisa buat databasenya.simpan pada satu project visual basic yang kita buat.
pada jendela vb6,klik edit -> reference ,cari "microsoft active object library 2.8" untuk microsoft access 2003 "microsoft active object library 2.6"untuk microsoft access 2003 kebawah.
klik jendela kode,ketikkan variabel berikut pada general
dim kon as new ADODB.Connection
dim tbl as new ADODB.Recordset
dim lok as new String
Klik 2 kali di area form
masukkan kode sebagai berikut :
lok=app.path
if right(lok,1) <> "\" then lok=lok & "\"
kon.Connectionstring="Provider=Microsoft.Jet.OLEDB.4.0;data source=" & lok& "word.mdb"
kon.open
klik 2 kali di commandbutton1
ketik kode sebagi berikut
tbl.open "select*from log where user='" & text1.text & "'",kon,OpenDynamic,LockOptimis
if !user=text1.text and _
!pass=text2.text then
msgbox"password benar",vbinformation,"Betul"
kon.close
else
msgbox"Password salah",vbcritical,"Salah"
kon.close
end if
mungkin segitu dulu deh,maaf klo ada yang ga jalan.gw ga liat aplikasi vb6 sama sekali. |
|
|
| Trackback Address :: http://www.blogboleh.com/eyu/trackback/9 |
|
|
|
|
|
| eyu
Klo ga muncul
pic gw refresh |
<<
2012/05
>>
| S |
M |
T |
W |
T |
F |
S |
|
|
1 |
2 |
3 |
4 |
5 |
| 6 |
7 |
8 |
9 |
10 |
11 |
12 |
| 13 |
14 |
15 |
16 |
17 |
18 |
19 |
| 20 |
21 |
22 |
23 |
24 |
25 |
26 |
| 27 |
28 |
29 |
30 |
31 |
|
|
|
|
Total : 1393
Today : 4
Yesterday : 1 |
|
|