【VB开源代码栏目提醒】:网学会员--在 VB开源代码编辑为广大网友搜集整理了:执行任务.frm绩等信息,祝愿广大网友取得需要的信息,参考学习。
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form frmExeWork
Caption = "执行任务"
ClientHeight = 4980
ClientLeft = 60
ClientTop = 345
ClientWidth = 7305
LinkTopic = "Form1"
ScaleHeight = 4980
ScaleWidth = 7305
StartUpPosition = 3 '窗口缺省
Begin MSAdodcLib.Adodc Ado2
Height = 375
Left = 5280
Top = 120
Visible = 0 'False
Width = 1800
_ExtentX = 3175
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc2"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MSAdodcLib.Adodc Ado1
Height = 375
Left = 4080
Top = 120
Visible = 0 'False
Width = 1920
_ExtentX = 3387
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Pass
word = ""
RecordSource = ""
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.Frame Frame1
Caption = "工作信息"
Height = 4455
Left = 120
TabIndex = 2
Top = 480
Width = 7095
Begin VB.OptionButton Option2
Caption = "未完成"
Height = 375
Left = 2520
TabIndex = 10
Top = 2400
Width = 1455
End
Begin VB.TextBox TxtResult
Height = 855
Left = 1320
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 7
Top = 2880
Width = 5175
End
Begin VB.CommandButton CmdExecute
Caption = "执行"
Height = 360
Left = 4560
Style = 1 'Graphical
TabIndex = 6
Top = 3960
Width = 800
End
Begin VB.CommandButton CmdExit
Caption = "退出"
Height = 360
Left = 5400
Style = 1 'Graphical
TabIndex = 5
Top = 3960
Width = 800
End
Begin VB.OptionButton Option1
Caption = "已完成"
Height = 375
Left = 1320
TabIndex = 4
Top = 2400
Value = -1 'True
Width = 1455
End
Begin VB.TextBox TxtDescription
BackColor = &H80000000&
Height = 1815
Left = 1320
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 3
Top = 480
Width = 5175
End
Begin
VB.Label Label3
Caption = "执行状态:"
Height = 375
Left = 360
TabIndex = 11
Top = 2520
Width = 975
End
Begin VB.Label Label2
Caption = "工作描述:"
Height = 375
Left = 360
TabIndex = 9
Top = 480
Width = 975
End
Begin VB.Label Label1
Caption = "执行情况:"
Height = 375
Left = 360
TabIndex = 8
Top = 3000
Width = 975
End
End
Begin VB.ComboBox CobSelect
Height = 300
Left = 1440
TabIndex = 0
Top = 120
Width = 3135
End
Begin VB.Label Label5
Caption = "选择工作:"
Height = 255
Left = 480
TabIndex = 1
Top = 120
Width = 1095
End
End
Attribute VB_Name = "frmExeWork"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Load()
Dim strItem As String
'实例化ADO控件:Ado1
Ado1.ConnectionString = ConnectionString '设置ADO控件的连接字符串
Ado1.CommandType = adCmdText '定义CommandType类型
Ado1.CursorLocation = adUseClient '定义CursorLocation类型
Ado1.LockType = adLockPessi
mistic '定义LockType类型
'定义数据源,构造SQL语句,得到工作状态为新建或更新的记录集
Ado1.RecordSource = "select * from 安排信息表 Where status in ('新建','更新') order by ftime"
Ado1.Refresh '刷新ADO数据控件
'初始化选择工作ComboBox控件
If Ado1.Recordset.RecordCount > 0 Then
CobSelect.Clear '清空控件
Do While Not Ado1.Recordset.EOF
strItem = Ado1.Recordset.Fields("name")
CobSelect.AddItem (strItem)
Ado1.Recordset.MoveNext
Loop
CobSelect.ListIndex = 0
Call LoadData '在控件中显示工作信息
Else '如果不存在需要执行的
工作信息
MsgBox ("没有需要执行的工作信息!")
Exit Sub
End If
End Sub
Private Sub LoadData()
'如果存在需要执行的工作信息,在控件中显示工作描述信息
Dim strDesc As String
Ado1.Recordset.MoveFirst
Ado1.Recordset.Find ("name='" & Trim(Cob