VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   3090
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   3090
   ScaleWidth      =   4680
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton cmdxoa 
      Caption         =   "Xóa"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   7320
      TabIndex        =   15
      Top             =   4080
      Width           =   1215
   End
   Begin VB.CommandButton cmdthoat 
      Caption         =   "Thoát"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   5640
      TabIndex        =   14
      Top             =   4080
      Width           =   1215
   End
   Begin VB.ListBox lstNhanvien 
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   3180
      Left            =   6600
      TabIndex        =   13
      Top             =   240
      Width           =   6495
   End
   Begin VB.OptionButton optnu 
      Caption         =   "Nu"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   3720
      TabIndex        =   12
      Top             =   2640
      Width           =   975
   End
   Begin VB.OptionButton optnam 
      Caption         =   "Nam"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   2400
      TabIndex        =   11
      Top             =   2640
      Value           =   -1  'True
      Width           =   975
   End
   Begin VB.CommandButton btnboqua 
      Caption         =   "Bo qua"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   4080
      TabIndex        =   10
      Top             =   4080
      Width           =   1215
   End
   Begin VB.CommandButton btnNhap 
      Caption         =   "Nhâp"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   2520
      TabIndex        =   9
      Top             =   4080
      Width           =   1215
   End
   Begin VB.TextBox txtHesoluong 
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   2520
      TabIndex        =   8
      Text            =   "2.34"
      Top             =   3240
      Width           =   1215
   End
   Begin VB.TextBox txtNgaysinh 
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   2400
      TabIndex        =   5
      Top             =   1800
      Width           =   2055
   End
   Begin VB.TextBox txtHoten 
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   2400
      MaxLength       =   50
      TabIndex        =   3
      Top             =   960
      Width           =   3615
   End
   Begin VB.TextBox txtManv 
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   2400
      MaxLength       =   5
      TabIndex        =   1
      Top             =   360
      Width           =   1695
   End
   Begin VB.Label Label7 
      AutoSize        =   -1  'True
      BorderStyle     =   1  'Fixed Single
      Caption         =   "He sô luong"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   420
      Left            =   240
      TabIndex        =   7
      Top             =   3480
      Width           =   1215
   End
   Begin VB.Label Label4 
      AutoSize        =   -1  'True
      BorderStyle     =   1  'Fixed Single
      Caption         =   "Gioi tính"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   540
      Left            =   120
      TabIndex        =   6
      Top             =   2640
      Width           =   1260
   End
   Begin VB.Label Label3 
      AutoSize        =   -1  'True
      BorderStyle     =   1  'Fixed Single
      Caption         =   "Ngày sinh"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   540
      Left            =   120
      TabIndex        =   4
      Top             =   1920
      Width           =   1170
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      BorderStyle     =   1  'Fixed Single
      Caption         =   "Ho và tên"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   540
      Left            =   120
      TabIndex        =   2
      Top             =   1080
      Width           =   1095
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      BorderStyle     =   1  'Fixed Single
      Caption         =   "Mã nhân viên"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   420
      Left            =   120
      TabIndex        =   0
      Top             =   360
      Width           =   1200
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim connectionstring As String
Private Sub hiennhanvien()
Dim sqlselect As String
sqlselect = "select Manv,Hoten,year(date())-year([Ngaysinh])as Tuoi from tblNhanvien"
Dim Cnn As New ADODB.Connection
Dim Rs As New ADODB.Recordset
Cnn.Open connectionstring
Set Rs = Cnn.Execute(sqlselect)
lstNhanvien.Clear
While Not Rs.EOF
lstNhanvien.AddItem Rs("Manv") & "-" & Rs("Hoten") _
& "(" & Rs("Tuoi") & "Tuoi)"
Rs.MoveNext
Wend
Rs.Close
Set Rs = Nothing
Cnn.Close
Set Cnn = Nothing
End Sub
Private Sub btnboqua_Click()
txtManv.Text = ""
txtHoten.Text = ""
txtNgaysinh.Text = ""
optnam.Value = True
txtHesoluong.Text = 3.14
txtManv.SetFocus
End Sub

Private Sub btnNhap_Click()
connectionstring = "Provider= Microsoft.JET.OLEDB.4.0; Data source = " & App.Path & "\Data\Nhanvien.mdb;"
Dim Cnn As New ADODB.Connection
Dim cmd As New ADODB.Command
Cnn.Open connectionstring
Set cmd.ActiveConnection = Cnn
cmd.CommandText = "qrythemnhanvien"
cmd.CommandType = adCmdStoredProc
cmd.Parameters.Append cmd.CreateParameter("@Manv", adVarWChar, adParamInput, 5, txtManv.Text)
cmd.Parameters.Append cmd.CreateParameter("@Hoten", adVarWChar, adParamInput, 30, txtHoten.Text)
cmd.Parameters.Append cmd.CreateParameter("@Ngaysinh", addate, adParamInput, , txtNgaysinh.Text)
cmd.Parameters.Append cmd.CreateParameter("@Gioitinh", adboolean, adParamInput, , optnam.Value)
cmd.Parameters.Append cmd.CreateParameter("@Hesoluong", adsingle, adParamInput, , txtHesoluong.Text)
cmd.Execute
Set cmd = Nothing
Cnn.Close
Set Cnn = Nothing
btnboqua_Click
hiennhanvien
End Sub

Private Sub Label5_Click()

End Sub

Private Sub cmdthoat_Click()
Unload Me
End Sub

Private Sub cmdxoa_Click()
If lstNhanvien.SelCount > 0 Then
Dim i As Byte
For i = 0 To lstNhanvien.ListCount - 1
If lstNhanvien.Selected(i) = True Then
lstNhanvien.ItemData(i) = ""
End If
Next
End If
End Sub

Private Sub Form_Load()
connectionstring = "Provider= Microsoft.JET.OLEDB.4.0; Data source = " & App.Path & "\Data\Nhanvien.mdb;"
hiennhanvien
End Sub

<html>
<head>
<title> Táº£i file</title>
</head>
<body>
<h3>CÃ³ lá»—i trong quÃ¡ trÃ¬nh táº£i file</h3>
</body>
</html>
