1 前言
1.1研究背景
1.2研究意义
1.3国际汽车租赁业务的发展及主要企业的经营模式
1.3.1 国际汽车租赁业的发展背景
1.3.2国际汽车租赁业的经营规模
1.3.3 经营、运作模式
1.4国内汽车租赁
1.4.1发展背景和过程
1.4.2国内汽车租赁业发展特点
2 理论综述
2.2 开发工具的选择
2.2.1 Visual Basic6.0简介
2.1.2 sql server2000简介
3 系统分析
3.1系统需求分析
3.1.1系统目标
3.1.2用户需求
3.1.3性能需求
3.1.4其他需求
3.2可行性分析
3.3系统功能分析
4系统总体设计
4.1系统数据流图
4.2 E-R图
5 系统详细设计
5.1 各功能模块流程图
5.1.1 登陆程序流程图
5.1.2 用户添加程序流程图
5.1.3 租赁管理流程图
5.2 数据库设计
5.2.1 数据库的概念及特点
5.2.2 数据库表设计
6 系统实现及测试
6.1 主要功能模块设计与实现
6.1.1 登陆模块的界面
6.1.2 汽车查询界面
6.1.3汽车租赁界面
6.1.4汽车归还界面
6.1.5客户资料界面
Adodc1.RecordSource = sql
Adodc1.Refresh
If Adodc1.Recordset.EOF Then
MsgBox "没有符合查询条件的记录!", , "昌华汽车租赁管理系统"
End If
Set DataGrid1.DataSource = Adodc1
End Sub
Private Sub Image2_Click()
Unload Me
End Sub
源程序代码:rivate Sub Imgadd_Click() '增加
Unlockctl
Dim temp1
temp1 = CStr(Year(Now))
Adodc1.RecordSource = "select * from 驾驶员档案 order
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
Adodc1.Recordset.MoveLast
Text1.Text = Year(Now) & Format(Val(Right(Ado
Else
Text1.Text = Year(Now) & "0001"
End If
'清空文本框内容
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text6.Text = ""
Text7.Text = ""
Text9.Text = ""
Text2.SetFocus
'设置控件状态
Imgok.Enabled = True
Imgcancel.Enabled = True
Imgupdate.Enabled = False
Imgdelete.Enabled = False
DTPicker1.Visible = True
Adodc1.Enabled = False
i = 1
End Sub
Private Sub Imgcancel_Click() '取消
On Error Resume Next '当没有添加数据的时候 处理异常
Adodc1.Recordset.CancelUpdate
Adodc1.Refresh
Lockctl
Text1.Text = ""
Imgok.Enabled = False
Imgcancel.Enabled = False
Imgadd.Enabled = True
Imgupdate.Enabled = True
Imgdelete.Enabled = True
Adodc1.Enabled = True
End Sub
Private Sub Imgdelete_Click() '删除
If MsgBox("您确实要删除记录吗?", vbOKCancel, "昌华汽车租赁管理系统"
cnn.Execute ("delete from 驾驶员档案 where 驾驶员编号='
MsgBox " 记录已删除!", , "昌华汽车租赁管理系统"
Adodc1.Refresh
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
DTPicker4.Value = Data
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Combo1.Text = ""
End If
End Sub
Private Sub Imgexit_Click() '退出
Unload Me
End Sub
Private Sub Imgfind_Click() '查询
Dim str As String
str = InputBox$("输入你要查询的驾驶员编号:", "昌华汽车租赁管理系统")
If str = "" Then Exit Sub
Adodc1.RecordSource = "select * from 驾驶员档案 where
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
Text1.Text = Adodc1.Recordset.Fields(0)
Text2.Text = Adodc1.Recordset.Fields(1)
Text3.Text = Adodc1.Recordset.Fields(2)
DTPicker1.Value = Adodc1.Recordset.Fields(3)
Text4.Text = Adodc1.Recordset.Fields(4)
DTPicker2.Value = Adodc1.Recordset.Fields(5)
DTPicker4.Value = Adodc1.Recordset.Fields(6)
Text6.Text = Adodc1.Recordset.Fields(7)
Combo1.Text = Adodc1.Recordset.Fields(8)
DTPicker3.Value = Adodc1.Recordset.Fields(9)
Text7.Text = Adodc1.Recordset.Fields(10)
Text8.Text = Adodc1.Recordset.Fields(11)
Text9.Text = Adodc1.Recordset.Fields(12)
Imgupdate.Enabled = True
Imgdelete.Enabled = True
Else
MsgBox "没有你需要的信息!", , "昌华汽车租赁管理系统"
Imgupdate.Enabled = False
Imgdelete.Enabled = False
End If
End Sub
Private Sub Imgok_Click() '确定
Select Case i
Case 1
If Text1.Text = "" Or Text2.Text = ""
MsgBox "每一项不能为空!", , "昌华汽车租赁管理系统"
Exit Sub
End If
Call main1
Dim rs As New ADODB.Recordset
' Set rs = adoCon.Execute("insert into 驾驶
rs.Open "select * from 驾驶员档案 ", adoCon,
rs.AddNew
rs.Fields(0) = Text1.Text
rs.Fields(1) = Text2.Text
rs.Fields(2) = Text3.Text
rs.Fields(3) = DTPicker1.Value
rs.Fields(4) = Text4.Text
rs.Fields(5) = DTPicker2.Value
rs.Fields(6) = DTPicker4.Value
rs.Fields(7) = Text6.Text
rs.Fields(8) = Combo1.Text
rs.Fields(9) = DTPicker3.Value
rs.Fields(10) = Text7.Text
rs.Fields(11) = Text8.Text
rs.Fields(12) = Text9.Text
rs.Update
MsgBox "记录添加成功!", , "昌华汽车租赁管理系统"
rs.Close
Adodc1.Refresh
adoCon.Close
Case 2
cnn.Execute ("update 驾驶员档案 set 驾驶员编号='"
MsgBox "记录修改成功!", , "昌华汽车租赁管理系统"
Adodc1.Refresh
End Select
Lockctl
Imgok.Enabled = False
Imgcancel.Enabled = False
Imgadd.Visible = True
Imgupdate.Visible = True
Imgdelete.Visible = True
Adodc1.Enabled = True
End Sub
Private Sub Imgupdate_Click() '修改
Unlockctl
i = 2
Imgok.Enabled = True
Imgcancel.Enabled = True
Imgadd.Enabled = False
Imgdelete.Enabled = False
DTPicker1.Visible = True
Adodc1.Enabled = False
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shif
If KeyCode = vbKeyReturn Then
If Text1.Text = "" Then
MsgBox "驾驶编号不能为空!", , "昌华汽车租赁管理系统"
Text1.SetFocus
End If
Text2.SetFocus
End If
End Sub
Private Sub Text2_KeyDown(KeyCode As Integer, Shif
If KeyCode = vbKeyReturn Then
If Text2.Text = "" Then
MsgBox "姓名不能为空!!", , "昌华汽车租赁管理系统"
Text2.SetFocus
End If
Text3.SetFocus
End If
End Sub
Private Sub Text3_KeyDown(KeyCode As Integer, Shif
If KeyCode = vbKeyReturn Then
If Text3.Text = "" Then
MsgBox "性别不能为空!", , "昌华汽车租赁管理系统"
Text3.SetFocus
End If
DTPicker1.SetFocus
End If
End Sub
Private Sub Text4_KeyDown(KeyCode As Integer, Shif
If KeyCode = vbKeyReturn Then
If Text4.Text = "" Then
MsgBox "驾驶证号不能为空!!", , "昌华汽车租赁管理系统"
Text4.SetFocus
End If
DTPicker2.SetFocus
End If
End Sub Private Sub Text6_KeyDown(KeyCode As Integ
If KeyCode = vbKeyReturn Then Combo1.SetFocus '按
End Sub
Private Sub Text7_KeyDown(KeyCode As Integer, Shif
If KeyCode = vbKeyReturn Then Text8.SetFocus '按
End Sub
Private Sub Text8_KeyDown(KeyCode As Integer, Shif
If KeyCode = vbKeyReturn Then Text9.SetFocus '按
End Sub
6.2.1 软件测试方法
6.2.2 登录系统测试
进行用户身份验证测试,当输入的用户名或密码有误时,给予提示。
数据添加测试
6.2.3数据修改测试
6.2.4 数据查询测试
6.2.5 数据删除测试