Professional Documents
Culture Documents
W
mahdiasihy@yahoo.com W
WI Q:
VB G N /0 @ ? 3 . R # Y< Z *X
\. ] / @ & ? /0 @ 2 ^_ % *[
VB
VB \. ] / Y 2 a% # b V8 *`
2
W $^ & Y2 & A_
Microsoft Access
$ % & '( ) (* " # ! ! " # !
userandpassword $ Table +, - . % & ' '! /01 2 3 Names
6 45!
3
<' ! Text A0> & '( XF YO! 0 Text1 and Text2 77! $(! *
6 ! ! 45! !2
6 ! ! # 2 45! ) 4H 2 ^ (1 ) @ "0 B. ! 9* I B 9
_ I$4H '* N J H &" L! < Labels W E MH ) J $H 6 RNK*
_$ I$4 ! K 9 ` ! Password 77 :! UserName 7 - B $H
7
3 4! 4 & '( )
; #5 ! " ! _L Microsoft Access 77! E * J )`2 6 RNK*
: ! ! 3 4! ) 4 cmdadd 3 4! 4
Private Sub cmdadd_Click()
Dim dbs As DAO.Database
Dim rcd As DAO.Recordset
If Me.txtusername = "" Then
MsgBox "Enter Your Name Please", , "Your Name"
Me.txtusername.SetFocus
Exit Sub
ElseIf Me.txtpassword = "" Then
MsgBox "Your Password Please", , "Your Password"
Me.txtpassword.SetFocus
Exit Sub
Else
Set dbs = OpenDatabase(App.Path & “\Names.mdb”)
Set rcd = dbs.OpenRecordset(“userandpassword”)
With rcd
.AddNew
rcd!UserName = Me.txtusername
rcd!Password = Me.txtpassword
.Update
Me.txtusername.Text = ""
Me.txtpassword.Text = ""
End With
End If
End Sub
8
: ! ! 3 4! ) 4 cmdcancel 3 4! 01 4
Private sub cmdcancel_Click()
If msgbox(“Are You Sure?”,vbYesNo + vbQuestion,”Cancel”)=vbYes then
End
Else
Exit sub
End if
End sub
C* # ! 9* L $H ) ." - C* # ! 9* ( B
End Sub
10
: ! ! 3 4! ) 4 cmdcancel 3 4! 01 4
Private sub cmdcancel_Click()
If msgbox(“Are You Sure?”,vbYesNo + vbQuestion,”Cancel”)=vbYes then
End
Else
Exit sub
End if
End sub
B(* 3 L ." l ) :! i" ! 9* ( B
VB T #a 9 " # ! & O $ ! = # SH m! :! C* # ! *
C* # ! B. 1 i" ! 01 g#5 & '( )
6 3 /01 < C* # ! n >
Command Buttons W f Labels o f n Text Boxes o
77 Text2 77! txtoldname 77 Text177! $ 3 ] "] $ & '( )
txtnewpassword 77 Text4 77! txtnewname 77 Text3 77! txtoldpassword
* cmdcancel 77 Command2 77! cmdchange 77 Command1 77!
*# ! =B. > ( =BF # S & ' K Label1,Label2,Label3,Label4
95 # SH <$( ) 8' 95 4! # SH +, =B 9 (%! 4! 8' =1 (L
Change User Name and 7 &" L! 01 I K: ? e" $N 01 &" L!
i "! &" L! # 4H & %! &" L ! Max Button 7! % & ' \Password
*K J txtnewpassword txtoldpassword 77! $(! * ' $!
/01 O! 01 4H ! 4! " B & %! B! % ! PasswordChar 77!
6 ! ! F B(! 45! ) 4 \\ [ Z *K J J $H +" 2 *K%!
11
Me.txtoldname.Text = ""
Me.txtnewpassword.Text = ""
Me.txtoldpassword.Text = ""
Else
MsgBox "The Name You enterd Not Found"
Me.txtold.SetFocus
Exit Sub
End If
End If
End Sub
: ! ! 3 4! ) 4 cmdcancel 3 4! 01 4
Private sub cmdcancel_Click()
If msgbox(“Are You Sure?”,vbYesNo + vbQuestion,”Cancel”)=vbYes then
End
Else
Exit sub
End if
End sub
B(* 3 L ." cK:! i " ! 9* I B F`
=4F 3 X! 2 9* $(H
B p 9$N + B* 6 = 2
mahdiasihy@yahoo.com