【VB开源代码栏目提醒】:网学会员VB开源代码为您提供data_output.frm参考,解决您在data_output.frm学习中工作中的难题,参考学习。
VERSION 5.00
Begin VB.Form data_output
Caption = "数据导出"
ClientHeight = 5160
ClientLeft = 60
ClientTop = 345
ClientWidth = 6435
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
LinkTopic = "Form1"
ScaleHeight = 5160
ScaleWidth = 6435
StartUpPosition = 2 '屏幕中心
Begin VB.CheckBox Check5
Caption = "考生报名表"
Height = 495
Left = 2280
TabIndex = 7
Top = 2880
Width = 2295
End
Begin VB.CommandButton Command2
Caption = "关闭"
Height = 495
Left = 3480
TabIndex = 6
Top = 4440
Width = 975
End
Begin VB.CommandButton Command1
Caption = "导出"
Height = 495
Left = 1440
TabIndex = 5
Top = 4440
Width = 975
End
Begin VB.CheckBox Check4
Caption = "考试安排表"
Height = 495
Left = 2280
TabIndex = 3
Top = 2160
Width = 2295
End
Begin VB.CheckBox Check3
Caption = "考场基本信息表"
Height = 495
Left = 2280
TabIndex = 2
Top = 3600
Width = 2295
End
Begin VB.CheckBox Check2
Caption = "成绩库"
Height = 495
Left = 2280
TabIndex = 1
Top = 1440
Width = 2175
End
Begin VB.CheckBox Check1
Caption = "考生库"
Height = 375
Left = 2280
TabIndex = 0
Top = 840
Width = 2055
End
Begin VB.Label Label2
Caption = "正在导出……"
ForeColor = &H000000FF&
Height = 375
Left = 5160
TabIndex = 8
Top = 120
Visible = 0 'False
Width = 1815
End
Begin VB.Label Label1
Caption = "选择需要导出的数据表:"
ForeColor = &H000000FF&
Height = 375
Left = 480
TabIndex = 4
Top = 240
Width = 2775
End
End
Attribute VB_Name = "data_output"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim str As String
Dim cn As New ADODB.Connection
Dim rs As ADODB.Recordset
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & App.Path & "\file.mdb;Persist Security Info=False"
If (Check1.Value = 0 And Check2.Value = 0 And Check3.Value = 0 And Check4.Value = 0 And Check4.Value = 0) Then
MsgBox "请选择要导出的数据"
Else
response = MsgBox("确定要导出这些数据吗?", vbOKCancel + 32, "提示")
If response = vbOK Then
Label2.Visible = True
If Check1.Value = 1 Then
cn.Execute "select zkzh as 准考证号,name as ,gentle as 性别,age as 年龄,address as 地址,dept as 所属单位,sfzh as 身份证号,photo as 照片地址 into [Excel 8.0;DATABASE=" & App.Path & "\student.xls].Sheet1 from info_stu"
End If
If Check2.Value = 1 Then
cn.Execute "select zkzh as 准考证号,name as ,tname as 考试类别,fs as 分数 into [Excel 8.0;DATABASE=" & App.Path & "\grade.xls].Sheet1 from info_grade"
End If
If Check3.Value = 1 Then
cn.Execute "select kno as 考场编号,kname as 考场名,knum as 容纳人数,kaddr as 考场地址 into [Excel 8.0;DATABASE=" & App.Path & "\place.xls].Sheet1 from info_place"
End If
If Check4.Value = 1 Then
cn.Execute "select zkzh as 准考证号,name as ,gentle as 性别,kname as 考场,zwh as 座位号,kaddr as 考场地址,tname as 考试类别,ttime as 考试时间,photo as 照片地址 into [Excel 8.0;DATABASE=" & App.Path & "\arrange.xls].Sheet1 from arrange"
End If
If Check5.Value = 1 Then
cn.Execute "select zkzh as 准考证号,name as ,gentle as 性别,age as 年龄,address as 地址,dept as 所属单位,sfzh as 身份证号,tno as 考场号,tname as 考场,ttime as 考试时间,tmemo as 考试说明,photo as 照片地址 into [Excel 8.0;DATABASE=" & App.Path & "\entrance.xls].Sheet1 from entrance"
End If
MsgBox "导出成功!数据已导出在当前目录下"
End If
End If
End Sub
上一篇:
CToolBar4View.cpp
下一篇:
法律专业开题报告范文