You are on page 1of 33

 

 

 
 

   



 

 !
 
& $ %"  2  5 $4(23 01"( (       .  +   ($  :  % 6 $484 9   78
 %   $@(   (   6= >8 ;(   $ + 1 =( C A ; % B% 7%=    3
; C  % E4 0  7H + 9 !  & $ 7%E";   +   78  % 0 1  9"( 
 ...
 1
J
 7K
% $
6 78
+

...C
:$4849M13
(= +


O 0"(
1+
 3
 $4 2
  5
 "
 6

$( N
1=

0 $
 1
 C
 
C
+
 
 1
C!
7P Q
5

 $
($( R
( 1
 S
+
 
+$
 T
 
+

 +84 93   0 1 % 6   + ;(  4  (=$4&  R =  !   C 7P +
&9 %

9 ";9 ( ";9  = (9
%


9 ";9 (  
.4 78 X  +8 ; P1 $ Y $ 61 (2 C C 7%E&
! >8 + %9  C4 8 ; %  $  %7 $ %%   
 4X
8 ; 8 Q5:
&9R

J(; 4 \ 
" ! C&.  
+1 (E 
( & (99((  +1 7$ (\ 
@C
)%= ; " ((E4 - (N
c$ 7 c :
 C7 "  $
 d(7%5  ( =( : =P c$ @-:C
( .  -:N
)  /N&4/9 g7(
/$/"//.; %7&(+
 . 
+1-:
) (/%  / N /E 4/R g7!/(// .(
7 C2;( 
2  "4 "M  + "4 Ci9"4  += i(2
 RP  9
9 C 6$.7
C("4c$-:
T74!
! "c +1 (E(E (\ 
%54 9k +1   E7(% :(= P(.$4 +1 7& 6

 E k7 6l + @(  ! C-:6$
6l  n& 2 +1
!1 $m P(.$4& 6 .5
  o K N 1 c %) A(  9(B/& E/(CS.
% 14
 & 
 ;(  T 6M4" J7  +1q
o=9 ;(  
(@ 7% 
 %(= C! 6;(44
(M  +1 q= =( :(  N; N  o5 (4%59 &9 (%
o= ( & . r. Jim. 
 o5 > @ >4Jim
 :(=  Q5( ! Cc$ (% E ! c  + %7";9 8  + 
2+
J(E"4&% (-:
  C(E& 2 +1 
 o5
69=9 ;(  
((E4NK C
" + c1;(  +1c$   7 K5.5
69% E 7  .5
( 7% 62$m %9
 . R :(= +1 (m& 6 E7 +  6c$
C(64= & . r.Jim
"(  % P 7P +1 T7 Jim N  o5 >8"  %
(; N 
 o5
-
--

-%6  !-:
 
C(4 +1" (B +1 =  $
- 9% -:($E
% +$4 9 ($E To ; P c$  6(; (=$ ;+
  Nhard ware -:

2 =(& $9 c$   C(B ! (. c$  . R  (  9
2   > P  9
 ($E +1 R1  ( J(1(=  ; c$ (  ($E +1 R1 % 7%"4 4&(= 
 7(-:
=6  N9.o .E ($1  N;soft ware -:+

2  7 N $9; +


 c$   (=$;(   1 + 1  % 7%"4  4
 ; ( -:
Microsoft Visual Studio 6.0  .
7%  .  %;( Microsoft Office Access 2003

2  ( 8  % + c$ =% .($E4
(
(
(
(
(


2 ;  T( $9 P C(B!4c$ = %&:+4
c T(4 " N9" 4E  4  (O..........
C("4 T(4 (S4 c$ .
 T(4 c$ .
C(B!4 T(4c$.

 %&6  T(4 9c$ 4 9 %i 6EE"(9 +c$ & + +:+


 d7 ( 9c$ % 1 ( c 4 @9  c %67 q" +%2     4%2 7% E4 ++
 ! :( +M C  7%(.c$ %59 " N9 &9 &@ J(E" C8 &%.
C(E4 (( T& (1M 6"4 + 9@ +1%59 % ;(  6 8(.$4 +1 (.l  \

.
C(E4 (;  +1 J.$4 +% $ E 7!1 > % %59 "6 N9
 %& 6    9 % i ( T :  & %   (%5 6%E( 9 + c$  E  %
 %i 6EE"(9 +c$ & +; @(  ( T7 >8 c$ =% S.7
. 9% !-:((B
 %$ $1 $9  n17 (.l  n  c ! Windows C(B%5 $9 +
c ! C(B% >  68 c$ 6 ! 7 8  l$   = >8 + 1  "(   $  7
 %E +1 :9  +%5c$ \ +1 
9  > C2  9k  + 1 2 P=   >8
 % c$ =% . ((B!4

--

-
4 c % ;(  % &-: (4
=% ( 7% C!7&-:+4
-: Dname (
) (/% 9((%
=% " C!7&-: +4
-:Present (
) (/% /E_ /N_4/_g7!/(//.(
=% E C!7&-:+4
-:Rname (
)   / E 9 / (
%= -:Sbname (  C!7&-: +4
)  / 9 / R( .
=% 
C!7&-:+4
-: Stname (
)  /N&4/9 g7(
/$/"//.; %7&(+
%= -: USERMAST (  (%5 C!7&-: +4
)(PASSWORD / NAME
c "-:
 C(4 
.
"%  A     ((E N .$
 +1 o$ %7%"4 7 (Sc$ + 1;(  (9 +%59 6 C2c$ 4 +
  % 9  +1 6SiS2&=P (  % +1 C@4 R8"(R
(  C +7 
 ;"7 C9  R  :(= +;( 
 o5 (C
 ((E4= 
 NK C o5 C7  % (1 N ! R9 =(:
;(  ;7 A( S$8  C  E(m ((i= :(; +(i 
+1c$ "+
8 9 C " 7   J7K  4%  +P57 6$ C  

--


"&   # $" %" !   
$ 2 ADO. NET %!
67 $ . 4 5 3


; > ?2= <7!


;2 4 . #" !  5  4  . 8 " AB 2 @ 
. .F ; DE
ADO. NETO5  7=M"& 6 L& 2 F P # 4.
!2 QO."
IJ.! 6H
!   T# S. D." !  " D@ 2 $ =  "&2 4Y
Z $  U< #" ! 
@ 5 D2  E . 63 
Z   #" ! 
; > $.= IE 4@2 42 Visual
.Basic .NET
  ADO. NET
ADO. NET $. 4". 6;M . 6 4 . 5A 7i
j System. Data  E.
!  Data Sources 2 D3= 6 8 = 4m; .# 4U"  2 . A &oA

"A # 6& .= " I  "#  2 7. 8


4&.7 4
7.  E. !  F =. D. &" rO5 " ADO. NET I J i $. S$ i
 :i S Connected Mode DEi S&;. Disconnected Mode DE
 6 Si < DEE=A E. S. !  =
 4  . Dy ; " -77
!>
 
= I  .{ 4=; S. 4 >AO=A E
}.
6 I.
2 $ 2$ 2
E. !  ~ 655 E. 6 DJ !  Y  5 8#.  .I.
2 DJ
6 . Si&;
@ $.
# 7 DE &  I == %  Inbox!  =  7 =  $.
{< =
D5 4 .F  . 2 ADO. NET S.
o2 I. # ! ?!y =E E. S.  2
" DE 5!   42=&#" 67E2 I !  655A= S. D.!  &" 6 -
= r. D. Si T  .DEF  7 = I&@ D2 ?Y=


o  Do 45A .7 " SQL
P . " 6 4 U Si&;J $.
7U DE 4 Y5!  " $ M. 4E ! . & 6F &6
 S }= I E "  2 E. $.  2 . $& Microsoft SQL Server =S. D.
!  =

 <{ $.5 !   E.  2 $.& .Microsoft Access 

@
= $. 655A  Si&; DE =  ;O. " ?yE !   6P7o O Servers
O}= 6 " D!# $. !
. $ Clients
 6F ;  5 DE  $" 63 Si  DE! %
;.5A IO E. S. D. ! 
 6 Si&;. DE
  .NET Data Providers
 P  4 U $. 7 &= 6O5 ADO. NET $" I.
2 4 Y5M 7 E 4;O ! 
; T!
. 6 7.O5
=! Y . " E.  2  $. Microsoft Access
7.O}5 . y S E.  2
J Microsoft FoxPro Microsoft SQL Server
... Oracle  
; >
 4o= IE .4
} F
;} r  @ $ D $. ADO. NET I <j 7!. 8
  ?Y@5 62
ro.  . $ .. $E !    6 ADO. NET
>!. DE= A 4Y Y  E.
!   =!
%  ?Y .
! 47oO}= 7 P. !  .NET Data Provider r i
 @ D :

--

.&  ! E. ADO. NET $ 2 D 4Y A 6 . .NET Data Provider ! P.


P.
= I " Microsoft Access & ! $. 2 E. O5 ADO. NET $. 
=
 J " "A" !  # <
! . Access 2 O .NET Data Provider
.Microsoft SQL Server 2 O P O5 I&. .  . D@ Microsoft SQL Server
<E U&. $.  ! E. $"
U& 2 ADO. NET O}5 .
! U&. $.
I "  r.O}= F !  E. < H F .NET Data Providers P.   = I " !
D3= .NET Data Providers P. $.  
o= .I.
2 S "& =P F; . 4
!J
J $" H % ! I " . 
D  %  = <  ! E. $. 4;O. 
.r 4& 4 
S#. 6 r.O}= F P
6 .NET Framework D" Z 6 4.". ! P. $. 4{{ o=

3 ;  COM

: OLE DB .NET Data Provider


4 &Y= " 4 &!. 4 # OLE DB P. O5 $. I&@ P $. &F
. Microsoft .NET 4 &Y= D!# P& !  E. T; O5

: SQL Server .NET Data Provider


Microsoft SQL Server $. S2} A2 P& !  E.  -J D@ 2 - ro. P F
OLE DB .NET Data &$. P O5 I  #  S. D. L2 .
.4Y2}Provider
: ODBC .NET Data Provider
$. $ .
! $ =@4& Y= ODBC 4& Y= 8 &    ! Y= D!# .NET 4 &Y= D!#
P  $. ) ;@
4;O ODBC Drivers .
Z $" 4;O !  E. 
O5  ODBC .NET Data Provides P $. 
.( 4
U 4  $.
!   r7 !>
  ODBC Drivers .
"A2 I E A OLE DB .NET Data Providers P. $.  ;D# 6 !  ) E.
.( 7 "
ADO. NET *+

U 6 4 } H M TJ $. 4Y . 7!j $@ M; $. !


4". " ADO. NET = 
LF  5 4 " Connection Command DataReader DataAdapter DataSet :() D@>
&H@ $ 2 ?2
 7.O5
Z <7 4Y  M;  P&
3
.A I " D7} 5 4 "Y M;
.7&. 4M &

--

.ADO. NET  M


2 : () D@>
4
5 4o FJ A "& $@ 4M 2 Y DE; DE; F 6 - L
2} - M; S o 6 DE5
DE= rY
Z $" 4M; LF $. $H   I " 
= Connection S. 2 H 4 =@ !%  . 7
.NET P. 
4 O}< 5 ) E=A; . QHEJ D 5   ! E2
.$H@ F S. (... O}Data Provider
I&@ Command &$.
J $H QHEJ
Z  $H@ F7 So
. D5
5 E= $H@ IH  2
 ! E. " (
j INSERT DELETE SELECT ) 4;O 5A Do F ;&= $.
.2} Connection$H@ 6  
 &{ $ 2 7  DE= Records 5 6 43. H&@ 5 Command $H@ 6 5A Do F ;&= 2
%  = S }= $ I < S. " DY D D5 D
# $. $@ DataReader &$. $H@
.$H@ F J $.  ! E.
&$. &H@ . Connected Mode DE Si 4 6 O}= 
2} 3 M;
J !  D3= 7 "< &6Y  . Y DE; 6 7 r2 !
J~
3@ o DataSet
. ! E. $.
&$. &H@  7#  r  75 !  E. $.  " !  E  I&@
J
!Y5 /5 $. I&@= 6 D P7 L "!I&@ DataAdapter &$. $H
Z $"DataSet
.Connection &H  $. ! 
Connection /01 2,
D!# . Connection &$. $H   2 E. S. r
= F E=A ADO. NET <" 6
(Disconnected Mode DE;& Si 6 8 )   &7. E=  I " 2 E. S. D.
. ! E2 E=  5A&
5 DE; $. <}Y F 6
Connection /0 2, 6
$. $ " O}5  4Y2} Connection 4M; $. r;
2 Y= $ I E= $H =&   .&"
$. E= $H
5 %  OLE DB .NET Data Provider &$. P A & E=A
:OleDbConnection 4M;
Dim msAccessCn As New OleDbConnection()
4M; SQL Server .NET Data Provider P S! r2 E=A =& F !  E.  .
: &F $. &H   $" 4M} 6 SQLConnection
Dim msSQLCn As New SqlConnection()
7o! = . $. ;5A $. I&@ . IDbConnection 47o =   " $ M;
:  ;
@
42 EJA $ "& D!Y} 
o 42 $. -3. $@=Polymorphism
Sub ConnectionDB( ByVal dbCon As IDbConnection)
--

End Sub
/01@
4 #   . E=A Q r  Connection String E=A Q I " E=A $H   2
 ! E. <5  ! E2 E=A 4 2 = 6> D( =  " String &$. ) 4 

 2 "# J " . 8& 4@!  6 7< 5 =@ # " !  ) # . "# }.
<5 (Microsoft SQL Server
: Microsoft &$. 2 E o 5&. 6 E=A Q  ... 
4 O}
Access
Dim connString As String = "Provider= Microsoft. Jet. OLEDB. 4.0;" _
& "Data Source= C:\ Folder\ Data. MDB;"
&5 I&@ y  P . " ! # . <5 Data Source P D.@< 5A  Provider % 
Dy 5 6 
Z 6 UA 8# E=A Q  &{ $ 2 Connection Timeout UA 8#
S. E=A ; 6 {
U& 5 6 E=A Q& E=A !  "& E. $. D;
U&. $H@
4 i
A 4 Y ) J
7U 5 r};  ! E. $. D ;
< =  87  ! E.
:( 4 { 6
Dim connString As String = "Provider= Microsoft. Jet. OLEDB. 4.0;" _
& "Data Source= C:\ Folder\ Data. MDB; Connection Timeout= 10"
5 I&@  E=A $H@ 42 ConnectionString 4 O   L&5 E= Q& I2 2
:$H@   4U  4M;  . !>
. E=A Q
Dim msAccessCn As New OleDbConnection()
msAccessCn. ConnectionString = connString
Dim msAccessCn As New OleDbConnection( connString)
E=A Q& I2 "& P< 5 D =I  SqlConnection &$. &H@ S. D.= .&"
&$. P A D!Y= A SqlConnection &$. &H@ 8"  7 2  !# !}
: SQL Server Data Provider
Dim msSQLCn As New SqlConnection()
msSQLCn. ConnectionString = "Data Source= Asd_ SERVER;" _
U+ VW0 XY 1 Password= T" &User ID= ;
1[\" &`_ ] Initial Catalog=
1/01 bc dX+
 ! E. S. E=A ;2 !I&@ ConnectionString 4 O 5& E=A Q& &5 2
:Open() 4Y
" 52
Dim msAccessCn As New OleDbConnection( connString)
Dim msSQLCn As New SqlConnection( connString2)
msAccessCn. Open ()
msSQLCn. Open ()
--

:Close() 4Y
" 52 r  4o  "& " E=A j o
y $.
msAccessCn. Close ()
msSQLCn. Close ()
4 #  =@# 6 Connecting E=A $H@ 42 State 4 O
Z $" E=A 4 4
. S }=
< Executing E=A  o Closed . E=A Open
;. E=A : < Y $.
3
: ! E. 5 $. 2 " E  o Fetching E=A " 5
. F ;&=
Dim cn As New OleDbConnection()

If (cn.State And ConnectionState.Open) <> 0 Then


cn. Close()
End If
StateChange < =;
 5 ( T@ ) Closed  Open $. E=A 4
= &" y  P
: E=A $H@2 O
Dim WithEvents cn As New OleDbConnection()
Sub cn_ StateChange( ByVal sender As Object, _
ByVal e As System. Data. StateChangeEventArgs)
Handles cn. StateChange
If (e. CurrentState And ConnectionState. Open) <> 0 Then
"/01 dX+ V0Label1.Text = "
Elseif e.CurrentState = ConnectionState.Closed Then
"/01 bc V0Label1.Text = "
End If
End Sub
:opXT1 r0
$. 2 E& IF 6 &DJ ! 5  ~o & !
35A # 4!}  ! E. S. D."&
: Try End Try 
DJ !  E2 4O  ;
Si& 35A=;
Dim cn As New OleDbConnection()
Try
cn. Open()

Catch ex As Exception
MsgBox( ex. Message)
End Try
< A AE=A Garbage %  E=A  H 7H"= 5 I " 4Y2} Close() 4Y
 4!}&2
&  F  5 . < A & 2 ( 7" 4 =! ".&" ) &H@ 6Y Y   4U  A 7#j
:SY < Collection&35 S# 5 H 7H"5
Dim cn As New OleDbConnection()
--

Try
cn. Open()

Catch ex As Exception
MsgBox( ex. Message)
Finally
cn. Close()
End Try
&35A $ 2 ;
SqlException OleDbException & 35A& H" " A Dy; 
:
JA& 35A AE=A& H@2 4O
Try

Catch ex As OleDbException

Catch ex As Exception

End Try
Command t s 2,
" ! #  SQL 5A Do 5 6 4  O 6== " ! # S. E=A $ @= 2
"# 2 D =.Command E=A $H $. ;5A I&@  &
5 <}Y F 6 7=  . D 
. Connection
.A $H
Z $" ! 
t 2, 6
D{  O}5   Command 4M; $. r;
2 Y= $ I Command
. $H =&   .&"
OLE DB .NET Data Provider &$. E=A $H P.   Connection E=A $H P.
:OleDbCommand 4M; $.
. $H
5
Dim msAccessCmd As New OleDbCommand ()
4M; SQL Server .NET Data

P S! r.O5 =& F E=A $H P.  .


: 7 4J
.& H   $" 4M} 6 SqlCommand
Dim msSQLCmb As New SqlCommand()

7o! = . $. ;5A $. I&@ . IDbCommand 47o =   " $ M;
: "  ;
@
$. Q Y $ "& D!Y} 
o 42 $. -3. $@=Polymorphism
Sub CommandDB( ByVal dbCmd As IDbCommand)

End Sub
- -

E= S. ?2

:Connection E =$H S. r2 6  I " J Command
. $H@ IH  2
Connection4 O
Z $" E= $H  So
. &5 I&@
( connString) Dim cn As New OleDbConnection
Dim cmd As New OleDbCommand()
cn.Open()
cmd.Connection = cn
&$. P. S !E=A $H   E=A $H  S.
.A $H
=  i }&= A
4M;" " A I " IF SqlConnection 4M; $. rH  =< Y SQL .NET Data Provider
:E=A S. E? 2
 OLEDbCommand $" i"SqlCommand
Dim cn As New SqlConnection( connString)
Dim cmd As New SqlCommand()
cn.Open()
cmd.Connection = cn
<=  Connection E=A $H@2 Y { Z!=
=!? . Command
.A $H "!A $ " 6 Si
:
.A $H S. SQL 5A Do F ;&= $. $@= $ Close() 4Y
2 E=A $H j -3.
Dim cn As New OleDbConnection( connString)
Dim cmd As New OleDbCommand()
cn.Open()
cmd.Connection = cn
cn. Close()
cmd.ExecuteNonQuery()
$H   "
>!. D@ 2  ! E.  DE A
.A $H 8"  i }! I
7U 5
. 2 E.  DE L2 F E=

SQL 5A Do F ;&=


D LF ;&= =6 SQL5A 4o =   I  Command $H@ " 5 Do F ;&=
4 F ;&= 4o 4  Y= 4 .5 4o 6
4 6 7=  .
Y2 Y= " !  # 5 "
{= A 6 D I= 6 4 .5A D

} # 4 
Y; 6 
5 D $. &F7 SELECT
.A O} SQL 5A
.ExecuteXXX() " 
52 Command $H " F ;&= I&@
6 ExecuteNonQuery() 4Y
 O5 I " 4 F ;&= Do 6 SQL 5A Do 8 .
6 D I= 6 - } F 6 E# 6 4 F ;& D . ={
6 " } D3= 4 "4 Y2 =
.UPDATE INSERT INTO DELETE D3. " ! # o 5 6 =  =

- -

4 O  SQL 5A 4o 42 A I " ExecuteNonQuery()4Y


" 5 $. $@= 
:Command $H@ 42 CommandText
Dim cn As New OleDbConnection( connString)
cn. Open()
Dim sqlStatement As String = "UPDATE asd set name=asd where ID=2000
Dim cmd As New OleDbCommand()
cmd.Connection = cn
cmd.CommandText = sqlStatement
cmd.ExecuteNonQuery()
:Command 6 CommandText Connection $  O < # D 2 $ Y $
} . I&@
4M;  . S. E=A $H 5A 4o
. 52 I 
5
Dim cmd As New OleDbCommand ( sqlStatement, cn)
" I= 
=  ;5A Do F ;&= 4U  &35A
=; y2
F=  " 6&"
J
: %   4 " 6 6& DJ  !   E.
Try
cmd. ExecuteNonQuery ()

Catch ex As Exception

End Try

}#

Z {$. 4Y
Z  J $@ 
}Y 5A Do 6 SELECT
.A O5 =& .&"
. ExecuteXMLReader ExecuteScalar() ExecuteReader() :6 Command $H@ 42=
:ExecuteReader() 4Y

) $H@ 6 5A 4o 4  D3= DataReader &$. $H@2 =ExecuteReader() 4Y

:( DE; F $.DataReader ! $H}< Y 6 YA DataReader $H@ $" = 5Command
Dim cmd As New OleDbCommand(" SELECT * FROM asd, cn")
Dim dr As OleDbDataReader = cmd.ExecuteReader()
Do While dr.Read()
-----------------------------------------------------------Loop
dr.Close()
:ExecuteScalar() 4Y

:DY  I D3= 4 Y2 =D} Y $. ?Y  Field DY
Y ExecuteScalar() 4Y
 O}=
Dim cmd As New OleDbCommand(" SELECT name from asd where id=10, cn)
Dim Name As String = cmd.ExecuteScalar()
- -

F ;& 4"
5 P I D} $. $. 4 #
#
3 ExecuteScalar() 4Y
 I ;=

32  =5A 4o 8 r=


# < 5 F  A DY  DY $.
32  =5A 4o 8
.A D} S2 DY 
# < } D5 $.
A 3 D !5 " S
5 D@ 2 " }4
. 6 ExecuteScalar() 4Y
 $. ;5A I&@
:
E 
Dim cmd As New OleDbCommand(" SELECT COUNT(*) FROM asd , cn)
Dim countOfFrogs As Integer = CInt( cmd. ExecuteScalar())
:ExecuteXMLReader() 4Y

4Y
" 5 $. $@} SQL Server .NET Data Provider P O5
$@ O5 $@ Microsoft SQL4U" !   " # %  ExecuteXMLReader()
. XML 4M 72 }2 =6 7. SQL5A 4
. $. FOR XML
.A O5
4Y
  DataReader &$. $H@2 =ExecuteReader() 4Y
 8
  r !> 7.O5 System.XML.XmlReader &$. $H@2 =ExecuteXMLReader()
.DataReader S. -
!
Dim cmd As New SqlCommand(" SELECT * FROM asd ,cn)
Dim xmlr As System. Xml.XmlReader = cmd. ExecuteXmlReader()
Do While xmlr.Read()
MsgBox( xmlr.Value)
Loop
xmlr.Close()
DataReader ! $H
LF 5 ExecuteReader() 4Y2} 4Y
" 52 Command $H@ 6 5A 4o F ;&= 2
 
D!# 5A 4o $. 4=& } S o D3 DataReader &$. 2 $H@2 4Y

.rH  r " E  I  @&4
.   $. $H@ F $. ;5A I&@
2 $H 
O5
 y5   New
.A O= 5 S }= $ I DataReader 2 $H =&   .&"
OLE &$. Command $H@ P.   Command $H@ 42 ExecuteReader() 4Y

:OleDbDataReader 4M; $. 2 $H
5 I DB
Dim cmd As New OleDbCommand(" SELECT * FROM asd", cn)
Dim dr As OleDbDataReader = cmd. ExecuteReader()
6 SqlDataReader 4M; SQL Server P S! r.O5 =& F
.A $H P.  .
. 4J 2 &H   $" 4M}
Dim cmd As New SqlCommand (" SELECT * FROM asd", cn)
Dim dr As SqlDataReader = cmd.ExecuteReader
SqlDataReader OleDbDataReader $ M; 6 4 . IDataReader 47o 
J
.
: $ "& $. $H r 5 6 D!Y}
o =
 I&@ 
Sub ReaderDB( ByVal dr As IDataReader)

End Sub

- -


}#
4Y
" 52 A $ =J 6 r=5
# 6 !S }= DataReader 2 $H@ IH  2

DY < 5 7. D5
= 6 Item 4 O 4 #
# 7  <= 4 3 D} Y D   Read()
:r=
#
Dim dr As OleDbDataReader = cmd. ExecuteReader()
dr. Read()
MsgBox ( dr. Item(" -------)
dr. Read()
MsgBox dr. Item(" -------)
dr. Close()
False 4 Y2 4Y
 5 6 D} >
 DY < 5 Read() 4Y
 7  6"}=
. D 6
: Do LoopD@  F72 4Y 6  @7 D3.A O5A IF }4 7  8
Dim dr As OleDbDataReader = cmd. ExecuteReader()

Do While dr. Read()


Msgbox (dr. Item(" ------")
Loop
dr.Close()
) CInt() D  " " A
 y . Object &$. 4 Y2 H = Item 4 O
&2 =6 Getxxx() " " 
A I&@ I S. 4 Y 4H
Y ( CSng() ... CLng()
:D   O5A 4o  @
Dim age As Integer
age = CInt( dr. Item("---")
age = dr.GetInt32( 1)
$. ?Y T  I 6 !} Close() rY
Z "52 DataReader $H j
y2 & r !&< 7 $.
 4 D> < 5 Connection I. # 
2
3@2 I   U& E.

= Do
A 6> D" $. $@= $ Command
.A $H  2 DataReaderE=A $H
" JA
.4  LF 6 E=A $H @Close() 4Y
" 5
4 O ;  QHEO 
$. 4 i 4". " DataReader &$. &H@ = 
J
=6 Y  2 =6 FieldCounter 4 O ( r # T ) DY < 52 =6GetName
. Null DY   True 4 Y2  =IsDBNull 4Y
 I $. <A 4 Y2
Registration, Contacts
Registration :

.
.
.
U.
.
.

text
text
Text
&
text
Text
text

Last
First
MI
DY < 5
Address
IdNo
BirthDate
- -

2 }2 X

.
.
.
.
.
.
.
.
.
.

text
text
text
text
text
text
text
text
text
text

BirthPlace
Sex
Course
YrLevel
Guardian
TelNo
StudClass
Trimester
Sy_start
Sy_end

-
student

E-R diagram

First
Mi

Last

Idnn
nnnn

Address
Studclass

Student
Birthdate

Telno

Yrlevel

Birthplace

Sex

Cours
e

- -

Guardian

Subjects -
Yb\
.
.
.
.
.
.
.
.

o
Text
Text
Text
Text
Text
Text
Text
Text

[W VT
IdNo
Code
Description
Sec
Unit
Day
Time
Room

Description

IDNO

CODE

Subject

SEC

ROOM
UNIT

DAY

- -

TIME

- -

Contacts :
Users -1
Yb
.
.
.
.
.

o
<#
Q
Q
Q

F.

[W VT
CONTACT ID
NAME
ADDRESS
LOCATION
COMMENTS

E-R-Diagram

COMMENTS

CNTACT ID

USERS
LOCTION

ADDRESS

- -

NAME

+@ CS.

- -

2 b Y ]X t `_ 


2  2): =A o "$. $>@}  y 42. .
! " ! # =@
( $ .O} o - y  o 4 5   2 "Y  2 $  
: < 4.O}  72  2 "# D T } .
2 O5 =<

1-start

all programs

2-File

Microsoft Access
stud <52 2 "# =<  

New Blank database

- -

3-Blank

database

Save in file name

Create

4 =" !  "  # 8>

4-Table

New

- -

design view

o -  2  )(stname


 " D Y  ) 4
/<#=/<5A  /&/ /4;
(4#

o -  2   (dname)$


) " D <# / <5 (

o -    y)(present
) D <#/ <#/L <# =/ }@ /$ <#/4"Y/8#;
/4#
U./(
- -

o - "Y(rname):
)D /4"Y <5/4"Y@(

o -  )(sbname
)D <#/L <5/;
(4#

- -

(USERMAST) D } o -
( 
4 O}< 5 )D

- -

A@ CS.

- -


4 O}< 52 O D    -
1
Private Sub Command1_Click()
Unload Me
End Sub
Private Sub login_Click()
If txtpassword.Text = IIf(IsNull(Adodc1.Recordset.Fields("password")), "", Adodc1.Recordset.Fields("password")) And
txtusername.Text = Adodc1.Recordset.Fields("name") Then
MsgBox "Login succeded"
Load MDIForm1
Unload Me
MDIForm1.Show
Beep
Beep
Else
MsgBox "wrong password Try again"
txtpassword.Text = ""
txtpassword.SetFocus
End If
End Sub

[_2 \WX t & t t


- -

(4 A 4>  } )H
 & -
@
Private Sub Form1_Click()
End Sub
Private Sub aaa_Click()
Form6.Show
End Sub
Private Sub md_Click()
Form1.Show
End Sub
Private Sub mstud_Click()
Form3.Show
End Sub
Private Sub Picture1_Click(Index As Integer)
'frmIssue.Show
End Sub
Private Sub pp_Click()
Form5.Show
End Sub
Private Sub pres_Click()
frmIssue.Show
End Sub

- -

@#2

Private Sub room_Click()


Form2.Show
End Sub
Private Sub sub_Click()
Form4.Show
End Sub
Private Sub us_Click()
usermaster.Show
End Sub
Private Sub zs_Click()
search.Show
End Sub

show U\ \ o r  _ o_ V,   ][r U show \ t 1 [_ bp \o VT  _ o_

2\\ ] -

- -

\ - ] b

\ _ ] [_

- -

\ - ] \ T

\ - ] 0W

- -

\ -  _ ] b X1 VT1  V`t\

\ - ] 2_ W b

- -

\ - ] 2_ WW

\ - X 0 }

- -

\ - ".. $ "< ;&


/

E_mail:tv22000@yahoo.com
Tel:002/0107976725

- -

FollowFollow-up program that students

You might also like