Professional Documents
Culture Documents
!
) 567 84)
"# $$) ' +
! ,
/ $0 ) 1
..
! ' : "!
0! ! : ;7= < 0 !AB ? ) 7>= C
!A0' ;? <4 = ! <DE : ! " <! : !
:? ?7 857 " 'A
'?A
? 'A A4 . B ;7! <4 !AB
?O
MN = .. L
! A 8 BR ')
'E ! " B ! <4
/TS 8N; 8 !! ! R ')
' 8 B ! A
5 ! ' :! V
' 8N ; /TS ! V0)W ;7;
,O ! "
! VR A A$ A ;7 ! : !AB
=E V ;E0 ..]\ ! : A ;7 <A$ 8 B; !AN :
=; 'A0 =^ )L !AB =
56 .. 5 <6) 80% =B!AN :
R ) B' \4 bR=0 < ?; 'A\ B=A$ =$ < ..
=O !
) c? ? 8E
! 8E
.. +! <4 =$ .
! A A$ ;7! <4 <C=^
A$ ;7! <4; 5= ?O !! 57! ! <
^=' <C ..=^
' <C <5 V
6 5) " .. R ! " <C :; " R !:
!E
) :8
" <C " 74R ! " <C :A4O " V ; ;7 <C
)A0 <4B< )A0 6^! <$ \ <D
E
.. b$BR A A$ ;7 .C 8 !. <4
A =^
+)
;7R ! <C <4A4O Microsoft Visual Basic 6.0 V
A
)
' \4) VR AN
'^ )L .. 57
S ! .; A
N <A$=; A =^
! ;4! ;7 5
A4
N
)
' =) : \ 4! : \ < t
=; A 'A0 = !.. 5 :
+ 7<
6 ) V ! \$=^
N 5 Oracle 8; \ 5tO'=A )< <
6 .
! y< != <$A ? 7=^
N ?A SQL Server 7 ! != 4 ! ? 7 CD 8=^
N ~ Access . MySQL)= '
)
A AN
\ < t=; A ' 5!.. :
A =^
+)
;7R
N ~ . Microsoft Access
::: <C
)
'
B! <4A
N =; =^
!
5 A '0 <
A0
..
'
6AA + :
DAO
ADO
RDO
OO4O
? ..5 ! +? A =^
5 87 5AN AN ;7
; '< 0
ADO; 'ActiveX Data Object ; B
! E bR= /$=' < 0=? AN ;7
!: 8+> - <7T= - 8)
BR -=
) - c>=B -?AN ! + AN
.
! E ' < 0 /$=' ADO=^
8 6 SQL?A ': ; BSQL stands for Structured Query Language
<C>=B <?5! <C : 5 L =' SQL
) <B>' A0
. B=! <C 5 . '= RO ' /$! AN ;7
. '= \6 /$ ! AN
. '= /$ <7T
)
6 " "
)
6 84R = ... 8)
B . <5=. B = ! O !AB AE
<$ >=
B ! <4=< A ] !
!A =.!! "B
<C! <4; " A4O . " V
N ; " !)? y7A~ " .
' < 0 ; " . " ADO
)
' 1 R A A0 = " A ^= ! !!AB
) 0
OA? "7 bR L :
-1>. <7T
-2=. 8)
B
-3R .
0 ' -4 84 .
-5. c
-6=0) .
. <A 4! <W -7
<W -8 ^
. 07
- 9 <? ;7 .
A A0 = ! : "7 bR^A ?; ! E R A0' C
= ! : < < .
) <7W=!" ( :
;7
5?< )A0 ; " ' " RE
--!< "
' " 5OE / A - y - " ' " 8 ! )?A ?" !^ .? ;78D
?" ! ^' 1 ; B) ! CD! :?
0B ;57'?7 ! y CD 5
!? !
= ! O
) c 8)A$ 8
\D ;7 8E!A0 ;? <4 = !
^)
O! : =^
! .
N ' ;7 1 . <$0; := )'; =
8 B
A$ ;7! :? ! ;7! :C 7 "7
4' 1 ?
' ! : ) ' \4
0 ??=' 1 c
6 8
;7
6
'?A ! 'O< ] ! !A =' 1 ;? <!5 )?A
$E ;7
0 +)
;7 ...R A )?A = ? ) \4 'c
'=W B ' AN
! 5!A
6 <!5...
;7 :! 8C= N ... 8 B~ ?; ' V 5t bR R7 .: 5 ! =E
"
N 7]< " Blank DataBase TA! A
=E "
N 7]< " A Blank DataBase )?!
)
' V ! \$ O
0 ) V ! \$) =< 5 ;7A =< :
" Data " 5=
0 =\ !
N O =
)
!?N
: <= < V 5t' ;? Create " " CT Data
0 8B6 -
8B6 N =O! A ; Primary Key TA! A! "
B>=5
! '
4 CT)) V 5t' ;? (( O< =< ' V ! \$=<
"
4 " :
B'
B "7?4= 07 <)O O N]
4 .= "=7
" '
' A 5tO =0 8 ^A$ =< .
O ..
B=
B ' ' y B
4 N
6 E# " " !
^= " Users
A )?A "7
=< :
Note
Rows
Descreption
"
&
"
'
'
+
"
"
'
'
'
: ;=
Tools Name
Number
Note
'
'
'
'
;
!
"
"
RightToLeft True
: <DE ]
: "!AB!< t!
+ 8 ... ,AN " ,0 bR 8O A?' " ,N ' !
Menu Editor ; 7
.. O
)
6
+! "O A?) .. !
: <= A0 bR5
0\ '=4)
: + TA' / =$0 " .. " "N A?) ;O ! 0
A?' <, " ,0
A0) 8D; 7 " Toolbar1 ; 7 5O ;? < ! AD =E\ " 4)
\ ! 50! A?)
A?' A ;= !; B \ 4) Toolbar1 AD 8N : ;= A?' A Toolbar1 ; 7
. OA! < 7T
. OA! 8)
B'
. OA < W
. B'
. :!
. E
A0) 6
)
' \4) " A0) " A =
)
Insert Picture CT
< 8+! 8? A?) ;? A< 7T
B AD y \$=) 4! $=! \
<=
<==\
Index 1
Caption E
Key ExitButt
Image 6
ToolTipTex :! ! E
..+ TA'
&
'
&
&
'
"A$ 5'" 7AO R <0< 0)$; 7 .. ; N B= A0
Index 2
Caption :!
Key AboutButt
Image 5
ToolTipTex :! ! AB!
Index 3
Caption B'
Key HelpButt
Image 4
ToolTipTex :! B= B'
Index 4
Caption OA < W
Key PrintButt
Image 3
ToolTipTex A / OA < W
Index 5
Caption OA 8)
B'
Key EditButt
Image 2
ToolTipTex OA 8)
B'
Index 6
Caption OA < 7T
Key AddButt
Image 1
ToolTipTex OA < 7T
< V 5t' ;? R7 ^ ! Ok CT ! =< 5=
B ::
: <=
Index 2
Style sbrDate
Index 3
Style sbrCaps
Index 4
Style sbrNum
Index 5
Style sbrText
Minimum Width: 4000.25
A A = O) ;? " Form " A " " 6L! =$CT " .. V 8 CT
TA!
RightToLeft True
A O" Save " O N . ,^ T
B
: <; 7 " frmCheckUser "
Number
#
;
: <=; < 7
.. + 8DO'
: 'Text2 & Text3 8 A< DE 8B6
Text2 PasswordChar *
Text3 PasswordChar *
Number
;
: <=; < 7
.. + 8DO'
: Text2 A< DE 8B6
Text2 PasswordChar *
Components... < D^ < 5t' ;? " Components " "= E
: 5 =; c
Microsoft ADO Data Control 6.0 (OLEDB)
VR
Microsoft DataGrid Control 6.0(OLEDB)
: <=; < 7
5=7T
' ' 4= Close CT Apply CT
'
)
' B
: ; ) 7
Save O C E ! frmSearchEditEmp A O : A =< T Tools Name
Number
Note
,
: <=; < 7
.. B T
: <= ,E
Column 1
Caption 1
DataField FirstName
Column 2
Caption 1
DataField FatherName
Column 3
Caption
4
DataField GrandName
: 8? R5 A 8? A?) ;? " Ok " CT ! =< 5=> B
Number
;
: <=; < 7
Number
Note
#
;
: <=; < 7
: Check4 & Check3 & Check2 & Check1 Caption <DE 8B6
Check1 Caption <7T
Check2 Caption 8)
B'
Check3 Caption <W
Check4 Caption !
^=!
: Frame Caption <DE 8B6
Frame Caption
Frame 8E; 7 Check CT
87 ; 6 8? A <0; < 7 M = MW E# A ;? Save .. O
M A 5 OT< =; 0)$~ O .. E# A T :::
;= ,^ C= N " !
^= 8)
B' " "= 5! A R
Name FrmEditUser
Caption !
^= 8)
B'
BorderStyle 1-Fixed Single
Font Tohama Regular 8
RightToLeft True
Save O C E ! frmEditUsers A O : A =< T Command3 Text3 R 07 " .. !
^= A " ~ O
Command6 Command5 Command4
: ; 5
Tools Name
Number
Note
;
: <=; < 7
( Last Record )
Command4 Caption
( Next Record )
Command5 Caption
( Prevuse Record )
Command5 Caption
( First Record )
Number
;
: <=; < 7
Number
Note
;
,
: <=; < 7
: <t!
( <OA - 1 - N ) .. 07 <=)
N ';
7 B )
: <=< 0)$
)N '
,E A0 A .. R
) L DataGrid CT
07 <
( <OA - 1 - N ?;
) Edit 5 ! =E
DataGrid Edit
: <=; < 7
" DREmp " " ~ O "tO) 0= O < V 5t' ;? O
: <=; < 7
" Text1 " ,^; 7 " A?) )0= RptTextBox : <t!
Number
;
: <=; < 7
. Microsoft ActiveX Data Objects 2.7 5 ! =E <= < V 5t' ;?
O ? )..
D> N 5) 1
. A7 7 7 8
A A0 ?=< A ' )B>'
0 A A0 =C=! )B
A0) "'
,7 >'
0 07?A != C Public
?A "
N ; B) DB :
;,0= 8 ?= < ,N 5t' <$0 " . " <= 4! <0; < 7 : 1
: ;= A? A?) A
Public DB As New ADODB.Connection
/! " ) 'C= R
,7 ..
A0 'A ! C=! 7 ; B)
; ) R ' 8? ))
B= A0) VR 07
N
ConnectionString >'
JET.OLEDB
~ =^
0 '
7 A? ( Oracle ) 8 : 8+! E
0 '8?
. =^! ( 'SQL Server )
: >'A ! +? +? ) R /NA R ) V?!
http://www.connectionstrings.com
.. ; 7 +
)/6
: ;=
'" ,7 E# C=! B A
( ... - c)
' - B= - 8)
B' - R - 84 <7T -
4= 7 )
RS C= A?) A
.. A?
Sub PoolConnection()
L4 R " A6 /$= ;? " !?8B4) A? t) " 07 "'
,7 L4 R
\$ L4 R; 7 A6A A? 8C'
) !
.. ; B) PoolConnection A 1 07
Sub
End Sub
If DB.State = adStateOpen Then DB.Close
.. A? R
adStateOpen " A=O! = State < DB
0 y If < 6 !
=1
.. ;= 8 Then DB.Close "A=O!
0 y
DB.Close
0 M]
< B bR
8 B
)
6 ! 5=7
0 ] 8
O) .
0; 7 8 !A?' 1 ;?
.. C'
DB.Provider = "Microsoft.JET.OLEDB.4.0";
DB.Provider
0 /! >'A B
: R\ =^
>' 4) ~
N /! )
>'
Microsoft.JET.OLEDB.4.0
:
N /! " >'E ! /$=' ;? L A R
DB.Open App.Path & "\Data.mdb"
Data 5
=; N =7
App.Path & "\Data.mdb"
; :!~ ! O ;7
0!
/T /$' :C 0; 7
0 ')
+!
0 ! C'
0' ; B)
.. 1'< < 0)$ bR5
! ( B=> ) SQL 8 6 8 ) "'
,7 String A ! C=! B= A0 A
: E# A A
Public SQLs As String
. E# A ;7 < 4 C= /$= ;? B=> < 4 O=) ;? L^
'" ,7
C A .
C L .
! .
CT . 'O
A .
A . C
? ! + 1 .
: 07
1
=^
R 4! ;7
. ; 7 Form_Load
. /! ;7 Text1_Change
A? " frmAddEmp " A A A0 A
8BO A !
" 1'>" ! < 0 ' " =0! b R " Emp " " R
4= O : A? R ! A? A?) A A?; =< 7
Private Sub Form_Load()
' A? )?=\ A
End Sub
: ;= ! A?) A 1'>; >' ! < 0= A 1
1'> < E ! >'0= A b ;. 07 4= 7 ; =< A$^ : ;= A 4= O ^A?
A? !
Private Sub Form_Load()
" R 8 = "
A
)<
PoolConnection
?A A " R L4 c) A " A?
! ) .. 1'> <
.. 5 ! ; >'0 ?; )=57 8E
)
4) !
8;
)7 " PoolConnection "
; bR ? y ! 1 R5 L4 R ?=< L! ~ y : <t!
.
B 7 A?< B= ;87 R!" A5O! \ =< 4) 5 7B' +
SQLs = "Select * From Emp"
Public SQLs As String 8);
7 b 7 R C= R' 8
. B=> < 6 C= R < N 07 8 4 8 ) L^ R
;7 A6A 8\ ; 6 " OA
6 ! ; B=; ' "
OA
6
If RS.State = adStateOpen Then Rs.Close
VR~
" DB " " RS " ?
V !
N A? R
.. 8BO B
/ 6 RE C=! A RS 0! N C= = ] O A0) 0! b A
- c)
' - R - <7T - B= -
6 =7 )
N ;7 ?= ,E
( ..
6 R -
6
If RS.State = adStateOpen
.. A=O! 4 C=! <
Then Rs.Close
: ;) ..
)
6 ! =O 5=) ;? C= M] .. B
RS.Open SQLs,DB,adOpenKeySet,adLockPessimistic
: 5 0 A RS.Open SQLs
bR 8C= N ) RO A? < 6 =7 " 4
4 ^ " C=!) y
. "
N < 4 = ) N " ( < 4
RS.Open SQLs,DB,
.. B .. !! ^ >'C= R ' " A DB , <DO
B
..
N B=) ;? >' L! B=' \ 4) < 6 RO = adOpenKeySet,adLockPessimistic
Cursor A? 8 TA' R .. <= < t
A? R
4' A
Private Sub Command1_Click()
' A? )?=\ A
End Sub
RO ' =) Click " C ="
5!
)
" 6 " " L R L 8? A R
8 B (
)
6 84 <7T> <5! A?' ;? "]7 5B4) ) A0 7 A
: A? R =\ V
=
" " = Text1.Text Text
A4 :
t A0 =; ' 5BT A .. t 8E 80A '
4 " " Text1
R 80'= C' /$ E ! 80 ^. Name <D
!! ~ : <tB! A ;7 80 A ! 80 )?A 1 B ;780
! +
Text1? " 8 Name: txtID +
R ) \4=
! E ! 1 ^A?) !
Name <D 80 A .
! :
" " = Text1.Text
) / ; B 8B67 80 " "
;N 8?A \
A0 =; ;7 A +)
;7R =^
! 6
A0 .. A )?A ?A =; :
! : <t " " O " Command2R ) \4=
! ' < ? , .. A
4R L4 ^ L :
)(Private Sub Command2_Click
End Sub
;7R L4 =?A ! "= 5=; :
: 5 !
A 8,
<))R'
$E
"!AB!
S
:
R A?A !
E =^ ! 6 ! 5=> B 1 0! A6A! A 8 8E N V= yN )'; : M A? 8O A? R=\
SQLs = " Select * From Emp where EmpNo = ' " & Text5 & " ' "
If RS.State = adStateOpen Then RS.Close
RS.Open SQLs, DB, adOpenKeySet, adLockPessimistic
If RS.EOF Then
GoTo OkAddNew :
Else
MsgBox " Sorry,The Number Exist Before", vbCritical+ vbMsgBoxRight," Error "
Exit Sub
End If
OkAddNew :
:A? !
.. T D !
SQLs = " Select * From Emp where EmpNo = ' " & Text5 & " ' "
. V)
5LE " 4 bR 8 A? C=!
' " & Text5 & " ' < 4)< 5 ;7 1
.
6 " 5! + ' 5 C! B bR
! ' " & & " ' B bR ! Text5 BT : )'; S
A4 :
;7=AN /! 8!B
) \4 '=A0
0 ^. 5 <D
?; '=B < 6 SQL> <7T =B R )
"E =^
!
E '?A y~ " " 80 V \4) VR=< bR!B ..
? ~ A?' 5 R5 ? .. ! 1 .. 8 \ A 80
N ;7 80
! A ..
' TA+
< 6 ;7>=B 'A0 :
10
=
6 ! B OA " ? 5 " A ) N ! +
) W A 7 )?A ) R R ( ..
R A B ;7! 8D "A A
N ;7 +! ;7 ..R " " "A EmpNo
: )'; M0'
GoTo OkAddNew :
A?' 1 < /T /$' . " OkAddNEW : " < ? \ .. ; B) R
. V A4O; 7 A4!
Else < 6 ; ) B) A? R
! )
( < 0 /6 Cursor ) N R5 OA
6 ; B) .. M0=)
: ( < =^
bR 5t ) A? R ) A
MsgBox " Sorry,The Number Exist Before", vbCritical+ vbMsgBoxRight," Error "
! E# A A6A! N R
'^A ;
Exit Sub
"B= 0' 1 6> ! E
End If
if < 6 <)5
GoTo OkAddNew :
: A? R ) A M0=) !
.. 5 N ;= ; ? < bR
GoTo OkAddNew :
~ N R
\ )= =
! 4) B! 84 <7T 8N : A 8 B N <0)$ bR5
... OA
N ;7 A6A!
1 " < =^
5t' N R A6A! 84 ) A A6A! ?)
. <7T>) ?
: A )=? '; =; 1 ;? N V= ! 5=>
B
N ;7
)
6 84 <7T
)
6 84 <7T < B ;= A?=\
6 " 5O ;? L6 A? 0 A
' ''; =^
< O C
! )= 8B4 A 1
" 1 / B O !=
! < y 8"
. O )= .. B
! )^=. 6> )^ ! . 1
! )^=-
MSGSave = MsgBox " Are You Sure To Save This Information?", vbQuestion+
vbMsgBoxRight+ vbYesNo, " Save "
If MSGSave = vbYes Then
' O
End If
" 1/ B " " < " A=' < =^
5t' ;? 8?5 R ##
!
MSGSave =
. ")
MsgBox O) A MSGSave " .. C=! R
'=^
V ) ; String A ! C=!
)' y V A4O< C ;7 BW
. (( String A )) 07 . ; =)7 57B' ] ! C=
MsgBox
)" O) A C= R
MSGSave = MsgBox " Are You Sure To Save This Information?", vbQuestion+
vbMsgBoxRight+ vbYesNo, " Save "
End If
If < 6 <)5
: ;= A
N ;7 O ^A? ?=< A0 A -
MSGSave = MsgBox " Are You Sure To Save This Information?", vbQuestion+
vbMsgBoxRight+ vbYesNo, " Save "
If MSGSave = vbYes Then
' O
RS.AddNew
If Not Text1 = " " Then RS![FirsName] = Text1
If Not Text2 = " " Then RS![FatherName] = Text2
If Not Text3 = " " Then RS![GrandName] = Text3
If Not Text4 = " " Then RS![FamliyName] = Text4
If Not Text5 = " " Then RS![EmpNo] = Text5
If Not Text6 = " " Then RS![Job] = Text6
RS.Update
MsgBox " The Information Has Been Saved ", vbInformation+ vbMsgBoxRight, " Save "
End If
. A? !
< '; 0! =^
5t' ;=
' < 0 .. <A5; ])< 7 !
.
4; 7 <7T>
RS.AddNew
RS.EOF Then
GoTo OkAddNew :
MsgBox " Sorry,The Number Exist Before", vbCritical+ vbMsgBoxRight," Error "
Exit Sub
/
5
OkAddNew :
MSGSave = MsgBox " Are You Sure To Save This Information?", vbQuestion+ vbMsgBoxRight+
vbYesNo, " Save "
MSGSave = vbYes Then
RS.AddNew
/
5
R A !: "= 5
' C? < )< < =^
AE =^
R A )8 " \4
=; :
=< < < )
0
=< <
)
4
'
<
)
4 ..
A A0 ! <4 A bR50)$<
? < )< . <D < )
0
A0) 1 =
' C? < )< -
<
)
4 != <0$
<
)
4 .
=
'
) c O <
)
4
6 ;7 . USERS
CT A L! CT ?; 'O= !R7 VB ?A ..
A ?=\ A ;7AO A )(Form_Load
8B4 1 RE) Text1 =^
8E!. :
= ;0>' !
). 8
SQLs = "Select * FROM Users Where UserName = ' " & UserNames & " ' and
Password = ' " & Text2 & " ' "
If RS.State = adStateOpen Then RS.Close
RS.Open SQLs, DB, adOpenKeyset, adLockPessimistic
If RS.EOF Then
MsgBox " Sorry,The Old Password Wrong ! ", vbCritical+ vbMsgBoxRight, " Error "
Exit Sub
Else
GoTo OKs :
End If
OKs :
!
SQLs = "Select * FROM Users Where UserName = ' " & UserNames & " ' and
Password = ' " & Text2 & " ' "
: ' A? < 6
8 ) R C=
=^
! =^
) ) 6 ! ; B=
( 2 80 ( ) < ' t 8E =^
If RS.State = adStateOpen Then RS.Close
RS.Open SQLs, DB, adOpenKeyset, adLockPessimistic
( " 4 8C= N ) =E .. 8N ! 5 '
If RS.EOF Then
MsgBox " Sorry,The Old Password Wrong ! ", vbCritical+ vbMsgBoxRight, " Error "
Exit Sub
< )
0 < AO " < =^
5 b
4) 84 E# S 8D
. b
B R A? < 6' < ?= 0' 1 6> ! E . " <WE
Else
GoTo OKs :
End If
OKs :
( =^
8BO A6A! ) < .. V]
OKs \
If )< 5
OKs
: ;= A? < 6' /=) ;? 8)
M0=
B c)
' < =^
)'; V
=B
. 8BO )A6A! < 1
MSGSave = MsgBox " Are You Sure To Change This Password?", vbQuestion+
vbMsgBoxRight+ vbYesNo, " Change Password "
If MSGSave = vbYes Then
' Update Password
SQLs = "Update[Users]Set[Password]=' " & Text4 & " ' Where [UserName]=' " &
UserName & " ' "
If RS.State = adStateOpen Then RS.Close
RS.Open SQLs, DB, adOpenKeyset, adLockPessimistic
MsgBox " The Old Password Has Been Changed ! ", vbCritical+ vbMsgBoxRight," Save "
End If
: !
A? < 6 1
)
6 A
6A) 1
SQLs = "Update[Users]Set[Password]=' " & Text4 & " ' Where [UserName]=' " &
UserName & " ' "
.. '
4 80" ) B6 A A
!
^=
6 c)
= N
" " O= UserName C= < N " =^
)
End Sub
L 8E A? R=\
VR]< 7 A0 =^
!
' 4 A 1
'
< /! < M$' \4)
: <t!
=^
- Text1
" - Text2
'
" - Text3
If Text1 = " " Then
MsgBox " Sorry, You Must Type Username ", vbCritical+ vbMsgBoxRight, "
Error "
Text1.SetFocus
Exit Sub
End If
If Text2 = " " Then
MsgBox " Please Type Old Password ", vbCritical+ vbMsgBoxRight, " Error "
Text2.SetFocus
Exit Sub
End If
If Text2.text <> Text3.text Then
MsgBox " Sorry,The Old Password Not Equel New Password ", vbCritical+
vbMsgBoxRight, " Error "
Exit Sub
End If
07
)
4 !
If Text2.Text <> Text3.Text Then
)1 ; B' <> "!B
1 \ B : 57 O < 5t =^
6
B :::
O =) A B =E
B
UserNames C=! ;7 ) =^
L^' =) UserPassword C=! ;7 5 )L^' =) < MDIForm1 ;, A 5 )= V
B A? R=\
SaveMsg = MsgBox " Are You Sure To Create Administrator ?", vbQuestion+ vbMsgBoxRight+ vbYesNo,
" Save Data "
SaveMsg = vbYes Then
RS.AddNew
RS![UserName]=Text1
RS![Password]=Text2
RS![GAdd] = True
RS![GEdit] = True
RS![GPrint] = True
RS![GCreateUser] = True
RS.Update
MsgBox " The Information Has Been Saved ", vbInformation+ vbMsgBoxRight, " Saved "
' Save This Informations
UserNames = Text1
UserPassword = Text2
' Long Main
Set RS = Nothing
Set DB = Nothing
MDIForm1.Show
Unload me
/
5
07
)
4 A A?
RS![GAdd] = True
R Yes/No 80 A
0; ' 7 ' A True < N GAdd 80
True / False ; B)
... "O R 80 VR 80 < 0 )= A
RS![GAdd] = True
RS![GEdit] = True
RS![GPrint] = True
RS![GCreateUser] = True
80 True < N
t AE
; 7 !
^= 4! ;7 =^
A : A4
. !
^= - <$ - 8)
B= - <7T> - ;
: M 8 \4) <D^ bR; 7 ?=' ;?
Set RS = Nothing
Set DB = Nothing
>'C=! VR ; 1 "= N 4
4 ^C= 8B6
; 1 ; B) !
"= N A?' B=> < 0 O )=4
4 C=!
7
6 B=
! )=
< 4 bR ?'< A0' C= ; 7! O
! ')
' R Null y
Nothing = C= Set
MDIForm1.Show
Unload me
( R" ! ,C ; ) A ; OE ;, A 5
&& = < /6&&
L! CT " CT " E " L
A? R=\
Unload me
/
5
/
5
/
5
SaveMsg = MsgBox " Are You Sure To Create Administrator ?", vbQuestion+ vbMsgBoxRight+ vbYesNo,
" Save Data "
SaveMsg = vbYes Then
RS.AddNew
RS![UserName]=Text1
RS![Password]=Text2
RS![GAdd] = True
RS![GEdit] = True
RS![GPrint] = True
RS![GCreateUser] = True
RS.Update
MsgBox " The Information Has Been Saved ", vbInformation+ vbMsgBoxRight, " Saved "
' Save This Informations
UserNames = Text1
UserPassword = Text2
' Long Main
Set RS = Nothing
Set DB = Nothing
MDIForm1.Show
Unload me
/
5
PoolConnection
/
5
/
5
SQLs = "Select * FROM Users Where UserName = ' " & Text1 & " ' "
If RS.State = adStateOpen Then RS.Close
RS.Open SQLs, DB, adOpenKeyset, adLockPessimistic
If RS.EOF Then
GoTo SaveOK:
Else
MsgBox " Sorry,The Username Is Exist Befor ", vbCritical+ vbMsgBoxRight, " Error "
Exit Sub
End If
SaveOK:
Text2.Text <> Text3.Text Then
MsgBox " Sorry,The Old Password Not Equel New Password ", vbCritical+ vbMsgBoxRight, " Error "
Exit Sub
/
5
SaveMsg = MsgBox " Are You Sure To Save This Informations ?", vbQuestion+ vbMsgBoxRight+
vbYesNo, " Save Data "
SaveMsg = vbYes Then
RS.AddNew
RS![UserName]=Text1
RS![Password]=Text2
' <7T>< D
If Check1.Value = True Then
RS![GAdd] = True
Else
RS![GAdd] = False
End If
' 8)
B=< D
If Check2.Value = True Then
RS![GEdit] = True
Else
RS![GEdit] = False
End If
Else
RS![GCreateUser] = False
End If
' <$< D
If Check4.Value = True Then
RS![GPrint] = True
Else
RS![GPrint] = False
End If
RS.Update
MsgBox " The Information Has Been Saved ", vbInformation+ vbMsgBoxRight, " Saved "
End If
)
4 A1 07 .. A?
If Check1.Value = True Then
RS![GAdd] = True
Else
RS![GAdd] = False
End If
; B) R
b !^=Check1 8
) A?
If Check3.Value = True Then
: ;= 8 ( b=E " =^
! " !^= ) !
' ,?
Check1.Value = True
Check2.Value = True
Check4.Value = True
Check3.Value = True
" b =< " !^=,? N 8B6
Esle
( ) " ~ !^=V]
Check1.Value = False
Check2.Value = False
Check4.Value = False
Check3.Value = False
b =< ] !^=,? N 8B6
: "E
A? R " =\ E " < =
/6 ::
Unload Me
: ;=
)
" 6 " "= = N A R; 7
)
6 T :::
/
5
/
5
SQLs = "Select * FROM Users Where UserName = ' " & Text1 & " ' "
If RS.State = adStateOpen Then RS.Close
RS.Open SQLs, DB, adOpenKeyset, adLockPessimistic
If RS.EOF Then
GoTo SaveOK:
Else
MsgBox " Sorry,The Username Is Exist Befor ", vbCritical+ vbMsgBoxRight, " Error "
Exit Sub
End If
SaveOK:
Text2.Text <> Text3.Text Then
MsgBox " Sorry,The Old Password Not Equel New Password ", vbCritical+ vbMsgBoxRight, " Error "
Exit Sub
/
5
SaveMsg = MsgBox " Are You Sure To Save This Informations ?", vbQuestion+ vbMsgBoxRight+
vbYesNo, " Save Data "
SaveMsg = vbYes Then
RS.AddNew
RS![UserName]=Text1
RS![Password]=Text2
' <7T>< D
Else
RS![GAdd] = False
End If
' 8)
B=< D
Else
RS![GEdit] = False
End If
' !
^= < D
Else
RS![GCreateUser] = False
End If
' <$< D
Else
RS![GPrint] = False
End If
RS.Update
MsgBox " The Information Has Been Saved ", vbInformation+ vbMsgBoxRight, " Saved "
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Command3_Click()
Text1 = ""
Text2 = ""
Text3 = ""
Check1.Value = False
Check2.Value = False
Check4.Value = False
Check3.Value = False
End Sub
'A TA :
-1R ) ; B A ^ frmSearchEditEmp cR A ) $BB! N
?; )= A ;7 " <4B " ' 8)
B " OA
-2 < 6 bR?A A ;7 .. A c )= \ 5, B! N !. B
SQLs C=! 8N ! NL^! <+ A )^L 8 6 "7?A A )= '^)L
< 6?A
=B .. B! N
+! ;7R < 6?A =; :
" ' SQLs = " Select * FROM Emp Where EmpNum = ' 20
< 6?A ! Public 5 "7B ) !" ( 8 )=AB$ ADA 5
>=O ! ^L ;7.. 5E
=) -3>=B ! E >'
0 .
EmpNo = Text5
If Not IsNull(RS![Job]) Then Text6 = RS![Job]
End Sub
/
5
/
5
/
5
/
5
/
5
/
5
/
5
' ----- Here We Use Rss Variable ----SQLs = "Select * From Emp Where EmpNo = ' " & Text5 & " ' "
If Rss.EOF Then
GoTo
/
Else
MsgBox " Sorry,The Employee Number Is Exist Befor ", vbCritical+ vbMsgBoxRight, " Error "
Exit Sub
End If
OkAddNEW :
' -----------------------------------Dont_Check :
SaveMsg = MsgBox " Are You Sure To Save This Informations ?", vbQuestion+
vbMsgBoxRight+ vbYesNo, " Save Data "
If SaveMsg = vbYes Then
RS.AddNew
If Not Text1 = " " Then RS![FirsName] = Text1
If Not Text2 = " " Then RS![FatherName] = Text2
If Not Text3 = " " Then RS![GrandName] = Text3
If Not Text4 = " " Then RS![FamliyName] = Text4
If Not Text5 = " " Then RS![EmpNo] = Text5
If Not Text6 = " " Then RS![Job] = Text6
RS.Update
MsgBox " The Information Has Been Saved ", vbInformation+ vbMsgBoxRight, " Saved "
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
PoolConnection
' SQLs = " It is Coming From From Search "
If RS.State = adStateOpen Then RS.Close
RS.Open SQLs, DB, adOpenKeyset, adLockPessimistic
' Go To This Sub
FillData
End Sub
.. A? !
General ; =)7 A? R7 ; 7 C=! )B= N 1
Dim EmpNo As String
C= R
: A4
)=?1 A N " 0! A N O=> A0) A C= R
O=) ;? C= R 7 .. =O R <t7 \ 4) . ;= O! A
1 !
.. ; ~ " R B=> C O^= A0 A .. A N
R ! ~ A! c A0) ~ " ; 8)
B= A ;7 A N C'
D
; ~ bC' =) C=! ]( A N ) 80 A?) !
..
' N ! .. <D^ bR $ /$=' <0)$ bR5 .. V= c
A6A! B .. 1 OA
A6A! N R 8 .. "B! "0 )= bC'
.. O '= < A A6A! ?) ! A6A! A
.. < 5t' A
Sub FillData()
On Error Resume Next
If Not IsNull(RS![FirsName]) Then Text1 = RS![FirsName]
If Not IsNull(RS![FatherName]) Then Text2 = RS![FatherName]
If Not IsNull(RS![GrandName]) Then Text3 = RS![GrandName]
If Not IsNull(RS![FamliyName]) Then Text4 = RS![FamliyName]
If Not IsNull(RS![EmpNo]) Then Text5 = RS![EmpNo]
' y?= < =; ! 0 LE C=!) y
EmpNo = Text5
If Not IsNull(RS![Job]) Then Text6 = RS![Job]
End Sub
" FillData " " A? O=) L6
<OA L4 R
B 7 B' ;? "!A5O! A?' =< 07 .. 5' 1 " =
... A?
L4 R
,7!
from_load A AO; 7 A E ! "' )= ! L4 R
( .. A0; 7 5T
4 ! RE ) ..
4 ! A0 B' A
'" ,7
On Error Resume Next
= $E
.. ; B'
\ B
;
/
5
/
5
/
5
/
5
/
5
/
5
/
5
' ----- Here We Use Rss Variable ----SQLs = "Select * From Emp Where EmpNo = ' " & Text5 & " ' "
If Rss.State = adStateOpen Then Rss.Close
Rss.Open SQLs, DB, adOpenKeyset, adLockPessimistic
If Rss.EOF Then
GoTo OkAddNEW :
Else
MsgBox " Sorry,The Employee Number Is Exist Befor ", vbCritical+ vbMsgBoxRight, " Error "
Exit Sub
End If
OkAddNEW :
' -----------------------------------Dont_Check :
SaveMsg = MsgBox " Are You Sure To Save This Informations ?", vbQuestion+ vbMsgBoxRight+
vbYesNo, " Save Data "
If SaveMsg = vbYes Then
RS.AddNew
If Not Text1 = "" Then RS![FirsName] = Text1
If Not Text2 = "" Then RS![FatherName] = Text2
If Not Text3 = "" Then RS![GrandName] = Text3
If Not Text4 = "" Then RS![FamliyName] = Text4
If Not Text5 = "" Then RS![EmpNo] = Text5
If Not Text6 = "" Then RS![Job] = Text6
RS.Update
MsgBox " The Information Has Been Saved ", vbInformation+ vbMsgBoxRight, " Saved "
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
()
;
Check1.Value = False
Check2.Value = False
Check4.Value = False
Check3.Value = False
/
5
/
5
/
5
/
5
/
5
SQLs = "Select * From Users Where UserName = ' " & Text1 & " ' "
Rss.State = adStateOpen Then Rss.Close
Rss.Open SQLs, DB, adOpenKeyset, adLockPessimistic
Rss.EOF Then
GoTo SaveOK :
/
MsgBox " Sorry,The Username Is Exist Befor ", vbCritical+ vbMsgBoxRight, " Error "
Exit Sub
/
5
SaveOK :
Dont_Check:
SaveMsg = MsgBox " Are You Sure To Update This Informations ?", vbQuestion+ vbMsgBoxRight+
vbYesNo, " Update Data "
SaveMsg = vbYes Then
' RS.AddNew
RS![UserName] = Text1
RS![Password] = Text2
' <7T>< D
Check1.Value = True Then
RS![GAdd] = True
RS![GAdd] = False
/
5
' 8)
B=< D
Check2.Value = True Then
RS![GEdit] = True
RS![GEdit] = False
/
5
RS![GCreateUser] = False
/
5
' <$< D
Check4.Value = True Then
RS![GPrint] = True
RS![GPrint] = False
/
5
RS.Update
MsgBox " The Information Has Been Saved ", vbInformation+ vbMsgBoxRight, " Saved "
/
5
;
Unload Me
/
5
;
;
;
;
;
;
PoolConnection
SQLs = "Select * FROM Users"
RS.State = adStateOpen Then RS.Close
RS.Open SQLs, DB, adOpenKeyset, adLockPessimistic
FillData
/
5
: A?
: A;
)< 7 C=! 7
Dim UserNa As String
< 80= 8 < " 4B =^
?; '= O=> C= R
,7
.. 5 ; 1 ; B=>
R
,7 4
4 ,E RE E A 0! "
' Rss C=!
: ;= A C=
A?) !
A$ 84 = A0) cursor A? B=> A0 !
) C=! \ =^
4) Rss '? !?< 8)
B' "7 A )
.. D 8? ) cursor < $ ( ?; )= RS,Rss )
" ali " 1 O " 8)
B= B! ^ ?=< A0) !
B7
+ 8 sql < 6 A?=7 " Sys " bC= =^
N
Select * From Emp Where Ename = ' Sys ';
cursor S /6) A < bR; 7
0; 7 A6A! ] Sys " 1
.. 5'= !?<
B' bR .. OD < 0
07 8)
B=< DE "7
6A) A OA 8)
B' A ;7 <? bR 8
RS,Rss )C=! /T\ 4)
Sub FillData()
0 ! A0 B' ? ) sub L4 R E ! FillData
)
6 L6
Text ; 7 5t' ;? 80
If RS.EOF Then
: ;= 8 ....... 84 E# Cursor
RS.MoveLast
84 E# Cursor 8B6
Beep
" \ " AD
D
End If
FillData
A0 B ^L4 8' ..
" E 84 "
On Error Resume Next
RS.MoveLast
E 84 cursor 4
4 C=!
FillData
;
/
5
SQLs = "Select * From User Where UserName = ' " & Text1 & " ' And Password = ' " & Text2 & " ' "
RS.State = adStateOpen Then RS.Close
RS.Open SQLs, DB, adOpenKeyset, adLockPessimistic
RS.EOF Then
MsgBox " Sorry, The Username And Password Is Wrong ! ", vbCritical+ vbMsgBoxRight, " Error Login "
'
'
/
5
/
5
;
Unload Me
/
5
PoolConnection
/
5
KeyAscii = 13 Then
Text2.SetFocus
/
5
KeyAscii = 13 Then
Command1_Click
/
5
: A
Text1 = "" Or Text2 = "" Then
MsgBox " Sorry,You Must Type The Username And Password ", vbCritical+ vbMsgBoxRight, " Error
Login "
Exit Sub
/
5
RS.EOF Then
MsgBox " Sorry, The Username And Password Is Wrong ! ", vbCritical+ vbMsgBoxRight, " Error Login "
V]
'
Long Main
Set RS = Nothing
.. ;, A 5
Unload Me
KeyAscii = 13 Then
Command1_Click
/
5
KeyAscii = 13 Then
;
/
5
SQLs = "Select * From User Where UserName = ' " & Text1 & " ' And Password = ' " & Text2 & " ' "
RS.State = adStateOpen Then RS.Close
RS.Open SQLs, DB, adOpenKeyset, adLockPessimistic
RS.EOF Then
MsgBox " Sorry, The Username And Password Is Wrong ! ", vbCritical+ vbMsgBoxRight, " Error Login "
/
5
;
Unload Me
/
5
PoolConnection
/
5
KeyAscii = 13 Then
Text2.SetFocus
/
5
KeyAscii = 13 Then
Command1_Click
/
5
A?
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + App.Path +
"\Data.mdb;Persist Security Info=False"
A? < 6 1
SQLs = "SELECT FirsName+' '+FatherName+' '+GrandName+' '+FamliyName As FullNames , "
: 5O + A? 8
O
lblCount.Caption = " Number The Records Is" & " " & Adodc1.Recordset.RecordCount & " " & "Record"
V Change
?; 'O= R7 V ?A '
Text1 = "" And Text2 = "" And Text3 = "" And Text4 = "" And Text5 = "" And Text6 = "" Then
: ! 8? A?
.. N 0 ) A?
" " ]7 5 A0 A?' !
::
Text1 = "" And Text2 = "" And Text3 = "" And Text4 = "" And Text5 = "" And Text6 = "" Then
RO ' =) B! AC! A0
A?) !
M=) 1 !
B7 :: ;+ 0!
A? L4 A .. L )= '07
6 85 A 8)AW ~ A? R . ! R
: N
sql < 6 1
SQLs = "Select FirsName+' '+FatherName+' '+GrandName+' '+FamliyName As FullNames , " & _
"EmpNo,Job FROM Emp" & _
"where FirsName Like '" & Text1 & "%'AND FatherName Like '" & Text2 & "%'AND GrandName Like '"
& Text3 & "%'AND FamliyName Like '" & Text4 & "%'AND EmpNo Like '" & Text5 & "%'AND Job Like
'" & Text6 & "%'"
A?
Set DREmp.DataSource = Adodc1
( Adodc " ) !
B6) ) 0=
^
DREmp.Show 1
show 1 .. , .. / 4 A7 "B6) 0= 5
.. A R ! 5= R?
" A! / OA < ! A 4! <W " A 8!? A? A R
;
Text1 = "" And Text2 = "" And Text3 = "" And Text4 = "" And Text5 = "" And Text6 = "" Then
Text1 = "" And Text2 = "" And Text3 = "" And Text4 = "" And Text5 = "" And Text6 = "" Then
#
Text1 = "" And Text2 = "" And Text3 = "" And Text4 = "" And Text5 = "" And Text6 = "" Then
;
Text1 = "" And Text2 = "" And Text3 = "" And Text4 = "" And Text5 = "" And Text6 = "" Then
;
Text1 = "" And Text2 = "" And Text3 = "" And Text4 = "" And Text5 = "" And Text6 = "" Then
Text1 = "" And Text2 = "" And Text3 = "" And Text4 = "" And Text5 = "" And Text6 = "" Then
: frmSearchEditEmp A 8 <0)W
=) ( <OA - N - 1 ) c 7A= E ! A c =^
A0)
B! ^
)
' =^
/$=)
B DataGrid B; ?< 7
A )= ! A " C
N\ 4 ( CD ) 5t) A
( OA 8)
B' )
" 07
)
4 1 " )= A .. !8! A? ?=\ A
+
,
Text1 = "" And Text2 = "" And Text3 = "" And Text4 = "" And Text5 = "" And Text6 = "" Then
SQLs = "Select * From Emp Where FirsName Like '" & Text1 & "%'AND FatherName Like '" & Text2 &
"%'AND GrandName Like '" & Text3 & "%'AND FamliyName Like '" & Text4 & "%'AND EmpNo Like '"
& Text5 & "%'AND Job Like '" & Text6 & "%'"
Adodc1.RecordSource = SQLs
Adodc1.Refresh
lblCount.Caption = " Number The Records Is" & " " & Adodc1.Recordset.RecordCount & " " & "Record"
DataGrid1.Columns.Item(0).Button = True
/
5
Text1 = "" And Text2 = "" And Text3 = "" And Text4 = "" And Text5 = "" And Text6 = "" Then
SQLs = "Select * From Emp Where FirsName Like '" & Text1 & "%'AND FatherName Like '" & Text2 &
"%'AND GrandName Like '" & Text3 & "%'AND FamliyName Like '" & Text4 & "%'AND EmpNo Like '"
& Text5 & "%'AND Job Like '" & Text6 & "%'"
Adodc1.RecordSource = SQLs
Adodc1.Refresh
lblCount.Caption = " Number The Records Is" & " " & Adodc1.Recordset.RecordCount & " " & "Record"
DataGrid1.Columns.Item(0).Button = True
/
5
#
Text1 = "" And Text2 = "" And Text3 = "" And Text4 = "" And Text5 = "" And Text6 = "" Then
SQLs = "Select * From Emp Where FirsName Like '" & Text1 & "%'AND FatherName Like '" & Text2 &
"%'AND GrandName Like '" & Text3 & "%'AND FamliyName Like '" & Text4 & "%'AND EmpNo Like '"
& Text5 & "%'AND Job Like '" & Text6 & "%'"
Adodc1.RecordSource = SQLs
Adodc1.Refresh
lblCount.Caption = " Number The Records Is" & " " & Adodc1.Recordset.RecordCount & " " & "Record"
DataGrid1.Columns.Item(0).Button = True
/
5
;
Text1 = "" And Text2 = "" And Text3 = "" And Text4 = "" And Text5 = "" And Text6 = "" Then
SQLs = "Select * From Emp Where FirsName Like '" & Text1 & "%'AND FatherName Like '" & Text2 &
"%'AND GrandName Like '" & Text3 & "%'AND FamliyName Like '" & Text4 & "%'AND EmpNo Like '"
& Text5 & "%'AND Job Like '" & Text6 & "%'"
Adodc1.RecordSource = SQLs
Adodc1.Refresh
lblCount.Caption = " Number The Records Is" & " " & Adodc1.Recordset.RecordCount & " " & "Record"
DataGrid1.Columns.Item(0).Button = True
/
5
;
Text1 = "" And Text2 = "" And Text3 = "" And Text4 = "" And Text5 = "" And Text6 = "" Then
SQLs = "Select * From Emp Where FirsName Like '" & Text1 & "%'AND FatherName Like '" & Text2 &
"%'AND GrandName Like '" & Text3 & "%'AND FamliyName Like '" & Text4 & "%'AND EmpNo Like '"
& Text5 & "%'AND Job Like '" & Text6 & "%'"
Adodc1.RecordSource = SQLs
Adodc1.Refresh
lblCount.Caption = " Number The Records Is" & " " & Adodc1.Recordset.RecordCount & " " & "Record"
DataGrid1.Columns.Item(0).Button = True
/
5
Text1 = "" And Text2 = "" And Text3 = "" And Text4 = "" And Text5 = "" And Text6 = "" Then
SQLs = "Select * From Emp Where FirsName Like '" & Text1 & "%'AND FatherName Like '" & Text2 &
"%'AND GrandName Like '" & Text3 & "%'AND FamliyName Like '" & Text4 & "%'AND EmpNo Like '"
& Text5 & "%'AND Job Like '" & Text6 & "%'"
Adodc1.RecordSource = SQLs
Adodc1.Refresh
lblCount.Caption = " Number The Records Is" & " " & Adodc1.Recordset.RecordCount & " " & "Record"
DataGrid1.Columns.Item(0).Button = True
/
5
: 07
)
4 A
L C
A)
N '
)
6
07 )
)
4
+
,
<
07
~ 07 !
^= R +)
;7
Case 0
SQLs = "SELECT * from Emp where EmpNo =' " & DataGrid1.Text & " ' "
. <A$ < 0)$ ; yNA= E R 07 N A ;7 5t) L N \
: ( A? < 6 ) ;= A? BT 0 "7AO Case 0 ~?; 7
SQLs = "SELECT * from Emp where EmpNo =' " & DataGrid1.Text & " ' "
'
)
) N ';
7 A B ) A N OA
6 ! B=
( 0 N< 7AO
End Select
Select y?)< < 5
frmEditEmp.Show
( OA 8)
B' ) A 5
Unload Me
R ; ! A 8 ' ;C .. ; OE
On Error GoTo xxx
A? LO0) :!\ ! $ .. 7 B! $E A?) !
.. $E!
xxx: 8\ R)
DataGrid1.Columns.Item(0).Button = True
(
)N ';
7 /' /$=' ! R E ! ) Button <D^
N ) '
V .. . ;+ A B; 7 A 8 Item(0) L'
!?
( .. A B "7AO
0! 5 ' " \ .. 5 =) A; N
)A0 =^ )L < ) - <W - 8)
B' - <7T !=^
! ( ;7 =C
B=
=^
R bR
!A0 : <t ' , A? 5B! 8!B= ;? <E .. '
N=
R
;7
A0R= .. , 07\ ;7 =
8 + :
! 'E 84
CT' ;? 1O= R7 ?A ?; ' < ,0 : TA! A
AddEmpMu.Enabled = True
Toolbar1.Buttons(6).Enabled = True
GAdd = " <7T"
/
AddEmpMu.Enabled = False
Toolbar1.Buttons(6).Enabled = False
/
5
' 8)
B'
RS![GEdit] = True Then
EditEmpMu.Enabled = True
Toolbar1.Buttons(5).Enabled = True
GEdit = " 8)
B' "
/
EditEmpMu.Enabled = False
Toolbar1.Buttons(5).Enabled = False
/
5
' <W
RS![GPrint] = True Then
PrintReport.Enabled = True
Toolbar1.Buttons(4).Enabled = True
GPrint = " <W "
/
PrintReport.Enabled = False
Toolbar1.Buttons(4).Enabled = False
/
5
' !
^=!
RS![GCreateUser] = True Then
CrUser.Enabled = True
EdUser.Enabled = True
GCreateUser = " !
^=! "
/
CrUser.Enabled = False
EdUser.Enabled = False
/
5
:A? !
MyGrants L6
Sub MyGrants()
' 6> R5 ^A?
End Sub
!
^=
6 E ! B=> < ; ) B! < "7 A?' A sub L4 R
.. 8$B' =) ;? ( =^
A6A B=
On Error Resume Next
:! 0) 0' 1 .. = $E
GAdd = " "
GEdit = " "
GPrint = " "
GCreateUser = " "
( < N 8 ' 1 <]7 5B6 ) C= ; 7 ;= 0 7 N
PoolConnection
( 1'> =" ) < E ! >'0= N
SQLs = "Select * FROM Users Where UserName='" & UserNames & "'and Password='" & UserPassword &
" '"
Else
False True < N <)
~ [GAdd] 80 V ]
: A? R AE
)= A
AddEmpMu.Enabled = False
(( <7T < )) ,0 8$B= N
Toolbar1.Buttons(6).Enabled = False
6 " Index N R< (( 7T )) L 8$B= N
End If
IF < 6 <)5
0B! !A?; N 8
<5=! A; N - 1 A4 A?) A c)
; 7 L !0; E y A4
5NW 5= ' ;7 C=' 07
5NA7 AD <7T ; .. =< $ <7T < B A0 A A?
=< B
. 8
8O 5B4 5,E 8)
B= A0 A .. ! ' R7 8O A?' ;? A bR
. R7
8
5T ! "7 /T?; )=
: <= < t . Picture1 AD <7T N
StatusBar1.Panels(5).Text
; )E
8B6 ( 5 N 8 ) R A ) < )
= " Username : " + UserNames
- C= < N RE )= - ; + 8 : =^
1 A key =^
1 A6A =) ;? "7=B " ;7=A Toolbar
=\ ?A =;
Load frmLogin
" R; 7 AE
84' " A 8 = N
Unload Me
R; ! , A C N
frmLogin.Show
" =^
AE
84' " A 5
save O E ! O
: =E < ,0 !
E !
: A? R " =\ CT
frmSearchEditEmp.Show
( OA 8)
B' A B N ) b B! R
!
^=
frmCreateUsers.Show
( !
^= A B N ) b B! R
! ^= 8) B'
: A? R " =\ CT
frmEditUsers.Show
: A? R " =\ CT
frmChangePass.Show
: A? R " =\ CT
frmAboutMe.Show
( ( ; R ) :! A B N ) b B! R
: < ,0\ !
Project EmpInfromation Properties
O N ! E Save O
/ 6 =O N R N A6A ;7 8 Text + A
) <7T ( OA t" :
: <= !
< B bR M W
frmLogin AE
84' A
frmChangePass <) ? < C' A
MDIForm1 ;, A \
< C'
AddEmpMu.Enabled = True
Toolbar1.Buttons(6).Enabled = True
GAdd = " <7T"
/
AddEmpMu.Enabled = False
Toolbar1.Buttons(6).Enabled = False
/
5
' 8)
B'
RS![GEdit] = True Then
EditEmpMu.Enabled = True
Toolbar1.Buttons(5).Enabled = True
GEdit = " 8)
B' "
/
EditEmpMu.Enabled = False
Toolbar1.Buttons(5).Enabled = False
/
5
' <W
RS![GPrint] = True Then
PrintReport.Enabled = True
Toolbar1.Buttons(4).Enabled = True
GPrint = " <W "
/
PrintReport.Enabled = False
Toolbar1.Buttons(4).Enabled = False
/
5
' !
^=!
RS![GCreateUser] = True Then
CrUser.Enabled = True
EdUser.Enabled = True
GCreateUser = " !
^=! "
/
CrUser.Enabled = False
EdUser.Enabled = False
/
5
End Sub
Private Sub AboutMu_Click()
frmAboutMe.Show
End Sub
Private Sub AddEmpMu_Click()
frmAddEmp.Show
End Sub
Private Sub ChanPass_Click()
frmChangePass.Show 1
End Sub
Private Sub CrUser_Click()
frmCreateUsers.Show
End Sub
Private Sub EditEmpMu_Click()
frmSearchEditEmp.Show
End Sub
Private Sub EdUser_Click()
frmEditUsers.Show
End Sub
If Check3.Value = 1 Then
Check1.Value = 1
Check2.Value = 1
Check4.Value = 1
Check3.Value = 1
End If
: Else <
R \
A0) D ?) 3 V
! ) B7 .. A? RO '
;0$ ! $E \) R : 1
" ,$ : A ?< 8 .. ( ?! ] 5B4) ) N R
8 A R . 5 N V= N .. V! 3 V
UserNa = Text1
! yR'
;7 L ! ) ; BR ! .. 8B4 A = < N RE) C80
0 ;? 1 N < ! 8>=B ) = V R =^
!A6A 1 ( .
VR ?< E A ;7 " =^
! " A . ?< 8)
B' ) <?! ~O
=^
! ( A /T?A !A 8
B )= \ " ' " !0
A ;7 " ' 8)
B =^
! "
MR ?A A ;7 " =^
! " R ?A M"0
;
Check3.Value = 1 Then
Check1.Value = 1
Check2.Value = 1
Check4.Value = 1
Check3.Value = 1
/
5
/
5
/
5
/
5
SQLs = "Select * FROM Users Where UserName = ' " & Text1 & " ' "
If RS.State = adStateOpen Then RS.Close
RS.Open SQLs, DB, adOpenKeyset, adLockPessimistic
If RS.EOF Then
GoTo SaveOK:
Else
MsgBox " Sorry,The Username Is Exist Befor ", vbCritical+ vbMsgBoxRight, " Error "
Exit Sub
End If
SaveOK:
Text2.Text <> Text3.Text Then
MsgBox " Sorry,The Old Password Not Equel New Password ", vbCritical+ vbMsgBoxRight, " Error "
Exit Sub
/
5
SaveMsg = MsgBox " Are You Sure To Save This Informations ?", vbQuestion+ vbMsgBoxRight+
vbYesNo, " Save Data "
SaveMsg = vbYes Then
RS.AddNew
RS![UserName] = Text1
RS![Password] = Text2
' <7T>< D
Check1.Value = 1 Then
RS![GAdd] = True
RS![GAdd] = False
/
5
' 8)
B=< D
Check2.Value = 1 Then
RS![GEdit] = True
RS![GEdit] = False
/
5
RS![GCreateUser] = False
/
5
' <$< D
Check4.Value = 1 Then
RS![GPrint] = True
RS![GPrint] = False
/
5
RS.Update
MsgBox " The Information Has Been Saved ", vbInformation+ vbMsgBoxRight, " Saved "
End If
/
5
;
Unload Me
/
5
;
PoolConnection
/
5
: $E
" \
< " =^
4; 7 =^
-1
.. A; 7 =^
5t) \ 4) -2
D 8? A=?! ] =^
1 C= A \ .. A C' ? ) 1 -3
$E R " TA ; ? 7 =^
8)
B= ) ? ?=< -4
;7 A A; 7 TA 8$= .. <t! .. 80; 7 <=? 8ON =) \ 4) 5
;7 +)
<)<
B6 !V ? ) " =^
/! 8O= "A C' ' ? 80 " 8D
: ;= A? =\ A 8 .. 07 R= =
Private Sub Command1_Click()
If Text2 = "" Then
MsgBox " Please Type Old Password ", vbCritical+ vbMsgBoxRight, " Error "
Text2.SetFocus
Exit Sub
End If
If Text3 = "" Then
MsgBox " Please Type New Password ", vbCritical+ vbMsgBoxRight, " Error "
Text3.SetFocus
Exit Sub
End If
If Text4 = "" Then
MsgBox " Please Type ReNew Password ", vbCritical+ vbMsgBoxRight, " Error "
Text4.SetFocus
Exit Sub
End If
Text3 <> Text4 Then
MsgBox " Sorry,The Old Password Not Equel New Password ", vbCritical+ vbMsgBoxRight, "
Error "
Exit Sub
SQLs = "Select * From Users Where UserName = ' " & UserNames & " ' and Password = ' " & Text2 & " ' "
RS.State = adStateOpen Then RS.Close
RS.Open SQLs, DB, adOpenKeyset, adLockPessimistic
RS.EOF Then
MsgBox " Sorry,The Old Password Is Wrong ! ", vbCritical+ vbMsgBoxRight, " Error "
Exit Sub
/
GoTo OKs :
/
5
OKs :
MSGSave = MsgBox " Are You Sure To Change This Password?", vbQuestion+ vbMsgBoxRight+
vbYesNo, " Change Password "
MSGSave = vbYes Then
' Update Password
SQLs = "Update[Users]Set[Password]=' " & Text4 & " ' Where [UserName]=' " & UserNames & " ' "
RS.State = adStateOpen Then RS.Close
RS.Open SQLs, DB, adOpenKeyset, adLockPessimistic
MsgBox " The Old Password Has Been Changed ! ", vbCritical+ vbMsgBoxRight," Save "
/
5
;
Unload Me
/
5
Text1 = UserNames
PoolConnection
/
5
80 " <) ? < C' A " = < /6 : <= A; 7 " ! A
^ ,=; :
Locked True
R ?; =) 1= C 80R A ) 8 =^
O ! E Save O <4= N >5 $E 5
\ A " !" :
Unload Me
) 0 ; ;7 " = 5? 'CD <t!
6A
; < ;7 : O =< :
<7T frmAddEmp OA =^
! frmCreateUsers < ;7 "B6 =) O7 A0 ! ! ~ BD /=! y
) ! c
)< ..
B OE msgbox=\ ?A R ) 8B4A0 7]< ?; )?A A
! .. E# 84 <7T> 5 bR; <0)$< B
! <tE : ;7 c c Adodc1
5,E=; :
" B " CT; 'A0
)' 8 '? EXE " )A B 5 ! =E
?; )= 8 V \6 ^A0 <D
=0) ] ...
B>=5
A ' V 5t bR< =< :
O < 7T> < bR V 5t' ;? .. !A Files < CT
' 8O.. +
;7' 1 N
4 )
4; !A6A "7 (
;7' 2 N
N A6A ! /
^=' y E
O /$=' txt or dll5=7T
;7
' 3 N 8 +
0 =) ;? 5 C' 5=7T . setup
) +)
;7 5R <7T
0
B .. 07A 5=7T ' 5 5 ;7A~
8O t< =< ..
: <= T
: V4! =E ! R
Windows\Profiles\Desktop "B6 Dest. Directory
: L)7
]4! ;7 V4! !R
Program Files\Employee 2006 "B6 Working Directory
: < /6= < bR ^ ! ok CT 5=>
B
0!
~ A A!A?< B' <0)W
(( ComboBox ))
A 8+! ( B! A? 8O' < ) =$0 A=! ~A A!A?;
)< 7 \=
!< " =\ AN =7 .." AddItem " = ^ E ... <0
.. <= A t? O TA= ... " M] ~A A!A?; 7 bA5
:
! A? A R
Dropdown Combo
<=? 8N
! VR
L 86 )= ; ! 80R 8 B <!
E ;7 80
{
N c L 86
} AAN
; tB
D
B
) / 6 M7A !S !S A' ! / 6 " )= N ! / 6
)L ..
= <A+
! M "#$) A 1 "7 .. AN 1 1
;B... tB
R 8 B C / 6 !S !S E
=; ; ;=$E L ;,N
D ;,? E L)L ;
A$ R ! ;7 ;B4 R 8 B VRL)L ;C
OB6 5
5= M7A!
; / 4 !S !S
.. /
BA8
O ;7
?) " .. 5 " W7
; B6L ;7 56
E1 "
; 6
Norton_k_sa@hotmail.com
www.vbteam.net
-------------------------------------------' M'
MN!: ;,
! OB65
Gafer343@hotmail.com
Created in :
Saturday : 23/12/2006 Time : 2:54 PM