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

📄 frmtimes_re.frm

📁 用户MODBUS规约通信编程,起参考作用.
💻 FRM
字号:
VERSION 5.00
Object = "{D959C709-8613-11D1-9840-002078110E7D}#1.0#0"; "as97Popup.ocx"
Object = "{C7AE747C-B9E4-11D7-B0E3-D8165009166E}#7.0#0"; "XPForm.ocx"
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form frmtimes_re 
   BorderStyle     =   0  'None
   Caption         =   "查询结果表明"
   ClientHeight    =   9960
   ClientLeft      =   0
   ClientTop       =   0
   ClientWidth     =   15090
   Icon            =   "frmtimes_re.frx":0000
   LinkTopic       =   "Form1"
   ScaleHeight     =   9960
   ScaleWidth      =   15090
   ShowInTaskbar   =   0   'False
   StartUpPosition =   3  '窗口缺省
   Begin MSFlexGridLib.MSFlexGrid flggrid 
      Height          =   6375
      Left            =   720
      TabIndex        =   0
      Top             =   1080
      Width           =   13815
      _ExtentX        =   24368
      _ExtentY        =   11245
      _Version        =   393216
   End
   Begin as97Popup.asPopup asPopup2 
      Height          =   615
      Left            =   5760
      Top             =   7920
      Width           =   1455
      _ExtentX        =   2566
      _ExtentY        =   1085
      Caption         =   "退出"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      BackColor       =   16761024
      ScaleWidth      =   97
      ScaleMode       =   0
   End
   Begin as97Popup.asPopup asPopup1 
      Height          =   615
      Left            =   3360
      Top             =   7920
      Width           =   1455
      _ExtentX        =   2566
      _ExtentY        =   1085
      Caption         =   "打印"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      BackColor       =   16761024
      ScaleWidth      =   97
      ScaleMode       =   0
   End
   Begin XP窗体控件.XPForm XPForm1 
      Height          =   810
      Left            =   5040
      Top             =   240
      Width           =   1920
      _ExtentX        =   3387
      _ExtentY        =   1429
      Caption         =   "查询结果表明"
      Icon            =   "frmtimes_re.frx":1CFA
      AlwaysOnTop     =   0   'False
      ShowFormSize    =   0   'False
   End
End
Attribute VB_Name = "frmtimes_re"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Dim conn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Public rs_1 As New ADODB.Recordset
Dim flag As Boolean

Private Sub asPopup1_Click(Cancel As Boolean)
DataReport3.Show

End Sub

Private Sub asPopup2_Click(Cancel As Boolean)
Unload Me
End Sub


Private Sub DataGrid1_RowColChange(LastRow As Variant, ByVal LastCol As Integer)


Dim begin_time, end_time As String
Dim Xj_type, Xj_lc As String
Dim txtsql As String
Dim txtsql1 As String
txtsql = "delete * from temp1"
conn.Execute (txtsql)
TimeDelay 100

begin_time = Mid(rs.Fields(0), 1, 10)
end_time = Mid(rs.Fields(0), 12, 21)
Xj_type = Trim(rs.Fields(1))
Xj_lc = Trim(rs.Fields(2))

txtsql = "select *  from 巡检结果表 where  巡检日期 >='" & Trim(begin_time) & " ' and  巡检日期 <= '" & Trim(end_time) & " ' and 采集器类型='" & Trim(Xj_type) & "' and 地点='" & Trim(Xj_lc) & " '"
'txtsql = "insert into temp1 select *  from 巡检结果表 where  巡检日期 >= '2003/09/18'and  巡检日期 <= '2003/09/18 '  and 采集器类型='一组' and 地点='3 '    "
' Text1.Text = txtsql
 Set rs_1 = conn.Execute(txtsql)
 
 Set frmrs.DataGrid1.DataSource = rs_1
frmrs.Show




End Sub

Private Sub flggrid_RowColChange()
If flag = False Then
Exit Sub
End If
Dim begin_time, end_time As String
Dim Xj_type, Xj_lc As String
Dim txtsql As String
Dim txtsql1 As String
txtsql = "delete * from temp1"
conn.Execute (txtsql)
TimeDelay 100
Dim txt As String
txt = Trim(flggrid.TextMatrix(flggrid.Row, 0))

begin_time = Mid(txt, 1, 10)
end_time = Mid(txt, 12, 21)
Xj_type = Trim(flggrid.TextMatrix(flggrid.Row, 1))
Xj_lc = Trim(flggrid.TextMatrix(flggrid.Row, 2))

txtsql = "select *  from 巡检结果表 where  巡检日期 >='" & Trim(begin_time) & " ' and  巡检日期 <= '" & Trim(end_time) & " ' and 采集器类型='" & Trim(Xj_type) & "' and 地点='" & Trim(Xj_lc) & " '"
'txtsql = "insert into temp1 select *  from 巡检结果表 where  巡检日期 >= '2003/09/18'and  巡检日期 <= '2003/09/18 '  and 采集器类型='一组' and 地点='3 '    "
' Text1.Text = txtsql
 Set rs_1 = conn.Execute(txtsql)
 
 Set frmrs.DataGrid1.DataSource = rs_1
frmrs.Show

End Sub

Private Sub Form_Load()
On Error Resume Next

Me.WindowState = 2

XPForm1.Make
flag = False
Dim connectstring, sqltxt As String

connectstring = "provider=Microsoft.Jet.oledb.4.0;" & _
            "data source=" & App.Path & "\jk.mdb"
 conn.CursorLocation = adUseClient
conn.Open connectstring

sqltxt = "select  * from 次数执行表"
Set rs = conn.Execute(sqltxt)
  flggrid.Clear
    flggrid.Cols = 8
    flggrid.FixedCols = 0
    flggrid.FixedRows = 1
    
    flggrid.ColWidth(0) = flggrid.Width / 7
    flggrid.ColWidth(1) = flggrid.Width / 8
    flggrid.ColWidth(2) = flggrid.Width / 8
    flggrid.ColWidth(3) = flggrid.Width / 8
    flggrid.ColWidth(4) = flggrid.Width / 8
    flggrid.ColWidth(5) = flggrid.Width / 8 - flggrid.Width / 112
    flggrid.ColWidth(6) = flggrid.Width / 8 - flggrid.Width / 112
    flggrid.ColWidth(7) = flggrid.Width / 8
   flggrid.TextMatrix(0, 0) = "巡检日期"
    flggrid.TextMatrix(0, 1) = "巡检类型"
    flggrid.TextMatrix(0, 2) = "地点"
    flggrid.TextMatrix(0, 3) = "计划周期"
    flggrid.TextMatrix(0, 4) = "计划人员"
     flggrid.TextMatrix(0, 5) = "计划次数"
     flggrid.TextMatrix(0, 6) = "实到次数"
    flggrid.TextMatrix(0, 7) = "执行结果"
    flggrid.Rows = 2
    
    If rs.EOF And rs.BOF Then
    Else
    rs.MoveFirst
    End If
    Do While rs.EOF <> True
     flggrid.TextMatrix(flggrid.Rows - 1, 0) = rs.Fields(0).Value ' Set Grid Col 0 the data from Row 0
        flggrid.TextMatrix(flggrid.Rows - 1, 1) = rs.Fields(1).Value ' Set Grid Col 1 the data from Row 1
        flggrid.TextMatrix(flggrid.Rows - 1, 2) = rs.Fields(2).Value ' Set Grid Col 2 the data from Row 2
        flggrid.TextMatrix(flggrid.Rows - 1, 3) = rs.Fields(3).Value ' Set Grid Col 3 the data from Row 3
        flggrid.TextMatrix(flggrid.Rows - 1, 4) = rs.Fields(4).Value
        flggrid.TextMatrix(flggrid.Rows - 1, 5) = rs.Fields(5).Value
        flggrid.TextMatrix(flggrid.Rows - 1, 6) = rs.Fields(6).Value
        flggrid.TextMatrix(flggrid.Rows - 1, 7) = rs.Fields(7).Value
       
       
        
        flggrid.Rows = flggrid.Rows + 1
        rs.MoveNext ' Remember to move to the next record.
    Loop
    
     flggrid.Rows = flggrid.Rows - 1
     
      Dim k, i, j As Integer
      k = flggrid.Cols
   
    For i = 1 To flggrid.Rows - 1
    
    flggrid.Row = i
    If flggrid.TextMatrix(i, 7) = "不合格" Then
    For j = 0 To k - 1
    flggrid.Col = j
    flggrid.CellForeColor = vbRed
    Next
    End If
    
    Next
    flggrid.Refresh
    
    flag = True
   
    


End Sub

Private Sub MSFlexGrid1_Click()

End Sub

Private Sub MSFlexGrid1_RowColChange()

End Sub

Private Sub Form_Unload(Cancel As Integer)
On Error Resume Next

Set conn = Nothing
Set rs = Nothing
End Sub

⌨️ 快捷键说明

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