📄 frmdatabase.frm
字号:
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
Begin MSDataGridLib.DataGrid DataGrid1
Bindings = "FrmDatabase.frx":0069
Height = 3975
Index = 1
Left = -74760
TabIndex = 2
Top = 480
Width = 6375
_ExtentX = 11245
_ExtentY = 7011
_Version = 393216
HeadLines = 1
RowHeight = 15
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ColumnCount = 2
BeginProperty Column00
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
Begin MSDataGridLib.DataGrid DataGrid3
Bindings = "FrmDatabase.frx":007E
Height = 3975
Index = 0
Left = 120
TabIndex = 1
Top = 480
Width = 6735
_ExtentX = 11880
_ExtentY = 7011
_Version = 393216
HeadLines = 1
RowHeight = 15
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ColumnCount = 2
BeginProperty Column00
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
End
End
Attribute VB_Name = "FrmDatabase"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim data(7)
Dim send(2)
Dim receive(2)
Private Sub CmdAll_Click()
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "SELECT * FROM 钻井数据表"
'设置ADODC控件的RecordSource属性为取所有的数据
Adodc1.Refresh
End Sub
Private Sub CmdBack_Click()
Unload Me
End Sub
Private Sub CmdDelete_Click()
Dim ans As Integer
ans = MsgBox("确定删除吗?", vbYesNo, "警告")
If ans = vbYes Then '询问是否删除
Adodc1.Recordset.Delete
End If
End Sub
Private Sub CmdDelete1_Click()
Dim ans As Integer
X = InputBox("请输入密码", "密码验证")
If Len(X) < 6 Then
Y = MsgBox("错误:你的密码不足6位!", vbOKOnly, "密码消息")
Else
If X = "123456" Then
ans = MsgBox("确定删除吗?", vbYesNo, "警告")
If ans = vbYes Then '询问是否删除
Adodc3.Recordset.Delete
End If
Else
MsgBox "密码输入错误"
End If
End If
End Sub
Private Sub CmdQuery_Click()
On Error Resume Next
Adodc1.CommandType = adCmdText
If Txtkeyword.Text = "" Then '判断是否选择查询条件
MsgBox "对不起!请输入您的查询条件!", vbOKOnly, "错误"
Else
Adodc1.RecordSource = "SELECT * FROM 钻井数据表 where " & Cmbitem.Text & " like'" & Txtkeyword.Text & "%'"
End If
Adodc1.Refresh
End Sub
Private Sub Cmdquery1_Click()
On Error Resume Next
Adodc2.CommandType = adCmdText
If TxtkeySend.Text = "" Then '判断是否选择查询条件
MsgBox "对不起!请输入您的查询条件!", vbOKOnly, "错误"
Else
Adodc2.RecordSource = "SELECT * FROM 发送人员表 where " & CmbSend.Text & " like'" & TxtkeySend.Text & "%'"
'执行查询语句
End If
Adodc2.Refresh
End Sub
Private Sub CmdQuery2_Click()
On Error Resume Next
Adodc3.CommandType = adCmdText
If TxtkeyReceive.Text = "" Then '判断是否选择查询条件
MsgBox "对不起!请输入您的查询条件!", vbOKOnly, "错误"
Else
Adodc3.RecordSource = "SELECT * FROM 人员短信回复表 where " & CmbReceive.Text & " like'" & TxtkeyReceive.Text & "%'"
'执行查询语句
End If
Adodc3.Refresh
End Sub
Private Sub CmdRecAll_Click()
Adodc3.CommandType = adCmdText
Adodc3.RecordSource = "SELECT * FROM 人员短信回复表"
'设置ADODC控件的RecordSource属性为取所有的数据
Adodc3.Refresh
End Sub
Private Sub CmdSendAll_Click()
Adodc2.CommandType = adCmdText
Adodc2.RecordSource = "SELECT * FROM 发送人员表"
'设置ADODC控件的RecordSource属性为取所有的数据
Adodc2.Refresh
End Sub
Private Sub Form_Load()
Dim str As String
Dim i As Integer
'动态连接数据库
str = App.Path
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & str & "\db1.mdb;Persist Security Info=False"
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select * from 钻井数据表"
Adodc1.Refresh
'str = App.Path
Adodc2.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & str & "\db1.mdb;Persist Security Info=False"
Adodc2.CommandType = adCmdText
Adodc2.RecordSource = "select * from 发送人员表"
Adodc2.Refresh
'str = App.Path
Adodc3.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & str & "\db1.mdb;Persist Security Info=False"
Adodc3.CommandType = adCmdText
Adodc3.RecordSource = "select * from 人员短信回复表"
Adodc3.Refresh
data(0) = "时间"
data(1) = "转盘扭矩"
data(2) = "立管压力"
data(3) = "泥浆池液位"
data(4) = "泥浆泵流量"
data(5) = "大钩负荷"
data(6) = "转盘转速"
For i = 0 To 6
Cmbitem.AddItem data(i)
Next i
Cmbitem.ListIndex = 0
send(0) = "工作人员姓名"
send(1) = "手机号码"
For i = 0 To 1
CmbSend.AddItem send(i)
Next i
CmbSend.ListIndex = 0
receive(0) = "手机号码"
receive(1) = "时间"
For i = 0 To 1
CmbReceive.AddItem receive(i)
Next i
CmbReceive.ListIndex = 0
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -