⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmstate.frm

📁 远程水文监测系统 利用vb通信实现远程监控功能。
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Frmstate 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "I/O状态设定"
   ClientHeight    =   2895
   ClientLeft      =   1380
   ClientTop       =   3030
   ClientWidth     =   5025
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2895
   ScaleWidth      =   5025
   Begin VB.CommandButton GurhanButton2 
      Caption         =   "返回"
      Height          =   375
      Left            =   3600
      TabIndex        =   17
      Top             =   2280
      Width           =   1095
   End
   Begin VB.CommandButton GurhanButton1 
      Caption         =   "确定"
      Height          =   375
      Left            =   2280
      TabIndex        =   16
      Top             =   2280
      Width           =   1095
   End
   Begin VB.TextBox Text1 
      Height          =   375
      Index           =   7
      Left            =   3720
      TabIndex        =   7
      Top             =   1440
      Width           =   975
   End
   Begin VB.TextBox Text1 
      Height          =   375
      Index           =   6
      Left            =   3720
      TabIndex        =   6
      Top             =   960
      Width           =   975
   End
   Begin VB.TextBox Text1 
      Height          =   375
      Index           =   5
      Left            =   3720
      TabIndex        =   5
      Top             =   480
      Width           =   975
   End
   Begin VB.TextBox Text1 
      Height          =   375
      Index           =   4
      Left            =   3720
      TabIndex        =   4
      Top             =   0
      Width           =   975
   End
   Begin VB.TextBox Text1 
      Height          =   375
      Index           =   3
      Left            =   1440
      TabIndex        =   3
      Top             =   1440
      Width           =   975
   End
   Begin VB.TextBox Text1 
      Height          =   375
      Index           =   2
      Left            =   1440
      TabIndex        =   2
      Top             =   960
      Width           =   975
   End
   Begin VB.TextBox Text1 
      Height          =   375
      Index           =   1
      Left            =   1440
      TabIndex        =   1
      Top             =   480
      Width           =   975
   End
   Begin VB.TextBox Text1 
      Height          =   375
      Index           =   0
      Left            =   1440
      TabIndex        =   0
      Top             =   0
      Width           =   975
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      Caption         =   "I/O_STATE.8"
      Height          =   255
      Index           =   0
      Left            =   2520
      TabIndex        =   15
      Top             =   1560
      Width           =   1095
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      Caption         =   "I/O_STATE.1"
      Height          =   255
      Index           =   1
      Left            =   240
      TabIndex        =   14
      Top             =   120
      Width           =   1095
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      Caption         =   "I/O_STATE.2"
      Height          =   255
      Index           =   2
      Left            =   240
      TabIndex        =   13
      Top             =   600
      Width           =   1095
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      Caption         =   "I/O_STATE.3"
      Height          =   255
      Index           =   3
      Left            =   240
      TabIndex        =   12
      Top             =   1080
      Width           =   1095
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      Caption         =   "I/O_STATE.4"
      Height          =   255
      Index           =   4
      Left            =   240
      TabIndex        =   11
      Top             =   1560
      Width           =   1095
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      Caption         =   "I/O_STATE.5"
      Height          =   255
      Index           =   5
      Left            =   2520
      TabIndex        =   10
      Top             =   120
      Width           =   975
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      Caption         =   "I/O_STATE.6"
      Height          =   255
      Index           =   6
      Left            =   2520
      TabIndex        =   9
      Top             =   600
      Width           =   975
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      Caption         =   "I/O_STATE.7"
      Height          =   255
      Index           =   7
      Left            =   2520
      TabIndex        =   8
      Top             =   1080
      Width           =   975
   End
End
Attribute VB_Name = "Frmstate"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rs As New ADODB.Recordset

Public Function excutesql(strsql As String)
Dim filename As String
filename = App.Path + "\db\db1.mdb"
dbcn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & filename
dbcn.Open
  rs.ActiveConnection = dbcn
    rs.Source = strsql
    rs.Open
End Function



Private Sub Form_Load()
Dim i As Integer
Dim strsql As String
strsql = "select * from io"
excutesql (strsql)
For i = 0 To 7
 Text1(i).Text = rs!name
 rs.MoveNext
Next
rs.Close
dbcn.Close

End Sub

Private Sub GurhanButton1_Click()
Dim i As Integer
Dim strsql As String
For i = 0 To 7
strsql = "update io Set name ='" & Text1(i).Text & "' where iono = '" & i + 1 & "';"
excutesql (strsql)
Label1(i).Caption = Text1(i).Text
'rs.Close
dbcn.Close
Next
MsgBox "保存数据成功!", vbOKOnly, "通知"
End Sub

Private Sub GurhanButton2_Click()
Unload Me
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -