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

📄 form3.frm

📁 可以与称重仪表连接
💻 FRM
📖 第 1 页 / 共 4 页
字号:
               Height          =   255
               Left            =   240
               TabIndex        =   22
               Top             =   600
               Width           =   975
            End
            Begin VB.Label Label6 
               Caption         =   "关 键 字"
               Height          =   255
               Left            =   240
               TabIndex        =   20
               Top             =   360
               Width           =   855
            End
         End
         Begin VB.Frame Frame5 
            Caption         =   "串口设置(&B)"
            Height          =   1695
            Left            =   120
            TabIndex        =   3
            Top             =   2160
            Width           =   2295
            Begin VB.ComboBox Combo5 
               Height          =   300
               ItemData        =   "Form3.frx":1D06
               Left            =   1080
               List            =   "Form3.frx":1D22
               TabIndex        =   38
               Text            =   "1"
               Top             =   1320
               Width           =   855
            End
            Begin VB.ComboBox Combo4 
               Height          =   300
               ItemData        =   "Form3.frx":1D3E
               Left            =   1080
               List            =   "Form3.frx":1D4E
               TabIndex        =   37
               Text            =   "7"
               Top             =   960
               Width           =   855
            End
            Begin VB.ComboBox Combo3 
               Height          =   300
               ItemData        =   "Form3.frx":1D5E
               Left            =   1080
               List            =   "Form3.frx":1D68
               TabIndex        =   36
               Text            =   "e"
               Top             =   600
               Width           =   855
            End
            Begin VB.ComboBox Combo2 
               Height          =   300
               ItemData        =   "Form3.frx":1D72
               Left            =   1080
               List            =   "Form3.frx":1D85
               TabIndex        =   35
               Text            =   "9600"
               Top             =   240
               Width           =   855
            End
            Begin VB.Label Label14 
               Caption         =   "停 止 位"
               Height          =   255
               Left            =   240
               TabIndex        =   34
               Top             =   1320
               Width           =   735
            End
            Begin VB.Label Label13 
               Caption         =   "数 据 位"
               Height          =   255
               Left            =   240
               TabIndex        =   33
               Top             =   960
               Width           =   735
            End
            Begin VB.Label Label12 
               Caption         =   "奇偶校验"
               Height          =   255
               Left            =   240
               TabIndex        =   32
               Top             =   600
               Width           =   735
            End
            Begin VB.Label Label11 
               Caption         =   "波 特 率"
               Height          =   255
               Left            =   240
               TabIndex        =   31
               Top             =   240
               Width           =   735
            End
         End
         Begin VB.Label Label3 
            Caption         =   "默认参数:"
            Height          =   255
            Left            =   240
            TabIndex        =   7
            Top             =   240
            Width           =   975
         End
      End
      Begin VB.Label Label10 
         BorderStyle     =   1  'Fixed Single
         Height          =   1095
         Left            =   240
         TabIndex        =   30
         Top             =   2880
         Width           =   2415
      End
      Begin VB.Label Label2 
         Alignment       =   2  'Center
         Appearance      =   0  'Flat
         BackColor       =   &H80000005&
         BorderStyle     =   1  'Fixed Single
         Caption         =   "5212117"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   26.25
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00FF0000&
         Height          =   615
         Left            =   240
         TabIndex        =   5
         Top             =   360
         Width           =   2415
      End
   End
   Begin VB.Label Label1 
      Caption         =   "Label1"
      Height          =   495
      Left            =   7560
      TabIndex        =   6
      Top             =   6960
      Visible         =   0   'False
      Width           =   975
   End
   Begin VB.Menu caidan 
      Caption         =   "菜单(&O)"
      Index           =   0
      Begin VB.Menu genggai 
         Caption         =   "更改用户(&C)"
         Index           =   1
      End
      Begin VB.Menu tuichu 
         Caption         =   "退出(&X)"
         Index           =   2
      End
   End
   Begin VB.Menu jbzl 
      Caption         =   "基本资料(&J)"
      Index           =   6
   End
   Begin VB.Menu shj 
      Caption         =   "系统设置(&S)"
      Index           =   6
   End
   Begin VB.Menu bangzhu 
      Caption         =   "帮助(&H)"
      Index           =   3
      Begin VB.Menu shiyong 
         Caption         =   "使用帮助"
         Index           =   4
         Shortcut        =   {F1}
      End
      Begin VB.Menu guanyu 
         Caption         =   "关于软件"
         Index           =   5
      End
   End
End
Attribute VB_Name = "Form3"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'****************************************************************************
'人人为我,我为人人
'枕善居收藏整理
'发布日期:2007/09/06
'描    述:地磅称重管理软件 beta 1.0
'网    站:http://www.Mndsoft.com/  (VB6源码博客)
'网    站:http://www.VbDnet.com/   (VB.NET源码博客,主要基于.NET2005)
'e-mail  :Mndsoft@163.com
'e-mail  :Mndsoft@126.com
'OICQ    :88382850
'          如果您有新的好的代码别忘记给枕善居哦!
'****************************************************************************

Dim cnnUser As New ADODB.Connection
Dim rstUser As New ADODB.Recordset

Private Sub Command1_Click()
 Dim xname As String
 Dim tmpop As String
 If List1.List(List1.ListIndex) <> "" Then
 tmpop = MsgBox("确定删除?", vbOKCancel, "提示:")
 If tmpop = 1 Then
     xname = Trim(List1.List(List1.ListIndex))
     cnnUser.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
     "Data Source=" & App.Path & "\db.mpp;" & _
     "Mode= ReadWrite | Share Deny None"
     cnnUser.Open
     With rstUser
     Set .ActiveConnection = cnnUser
    .CursorType = adOpenKeyset  'adOpenKeyset,adOpenStatic可使用Recordset的RecordCount,其他两个属性不行
     End With
     With rstUser
     If .State = adOpenKeyset Then .Close
     .Open "select * from [admin] where [name]='" & xname & "'", cnnUser, adOpenKeyset, adLockOptimistic
     .Delete
     .Update
     .Close
     End With
     cnnUser.Close
     List1.Clear
     List2.Clear
     data
 End If
 Else
 MsgBox "请选择用户!", vbOKOnly, "提示:"
 End If
 
End Sub

Private Sub data()
  Dim cc As String
  Dim i As Integer
  Dim dd As String
  
  cc = Label1.Caption
  cnnUser.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
   "Data Source=" & App.Path & "\db.mpp"
  cnnUser.Open
  With rstUser
    Set .ActiveConnection = cnnUser
    .CursorType = adOpenKeyset  'adOpenKeyset,adOpenStatic可使用Recordset的RecordCount,其他两个属性不行
  End With
  With rstUser
     If .State = adStateOpen Then .Close
     .Open ("Select * from admin")
      
      Do While Not .EOF
      dd = ""
      If rstUser.Fields("adm").Value = 1 Then
      dd = "是"
      End If
      If rstUser.Fields("name").Value <> "admin" Then
      List1.AddItem " " & rstUser.Fields("name").Value
      List2.AddItem " " & dd
      End If
     .MoveNext
      Loop
  
  End With
   cnnUser.Close
  
End Sub


Private Sub Command10_Click()
If tt2.Text <> "" Then
  cnnUser.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
   "Data Source=" & App.Path & "\db.mpp"
  cnnUser.Open
  With rstUser
    Set .ActiveConnection = cnnUser
    .CursorType = adOpenKeyset  'adOpenKeyset,adOpenStatic可使用Recordset的RecordCount,其他两个属性不行
  End With
     With rstUser
     If .State = adStateOpen Then .Close
     .Open "Select * from [jingyinghu] where jingying = '" & tt2.Text & "'"
     If Not .EOF Then
     MsgBox "数据已存在!", vbOKOnly, "提示:"
     tt2.Text = ""
     .Close
     cnnUser.Close
     Exit Sub
     End If
     .Close
  End With
  
  
  
  With rstUser
     If .State = adStateOpen Then .Close
     .Open "Select * from [jingyinghu]", cnnUser, adOpenKeyset, adLockOptimistic
     .AddNew
     ![jingying] = tt2.Text
     .Update
     .Close
  End With
  cnnUser.Close
  Call ddt
 
 Else
  MsgBox "请填写内容!", vbOKOnly, "提示:"
End If
tt2.Text = ""
End Sub

Private Sub Command11_Click()
If tt3.Text <> "" Then
  cnnUser.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
   "Data Source=" & App.Path & "\db.mpp"
  cnnUser.Open
  With rstUser
    Set .ActiveConnection = cnnUser
    .CursorType = adOpenKeyset  'adOpenKeyset,adOpenStatic可使用Recordset的RecordCount,其他两个属性不行
  End With
     With rstUser
     If .State = adStateOpen Then .Close
     .Open "Select * from [fahuo] where fahuo = '" & tt3.Text & "'"
     If Not .EOF Then
     MsgBox "数据已存在!", vbOKOnly, "提示:"
     tt3.Text = ""
     .Close
     cnnUser.Close
     Exit Sub
     End If
     .Close
  End With
  
  
  
  With rstUser
     If .State = adStateOpen Then .Close
     .Open "Select * from [fahuo]", cnnUser, adOpenKeyset, adLockOptimistic
     .AddNew
     ![fahuo] = tt3.Text
     .Update
     .Close
  End With
  cnnUser.Close
  Call ddt
  
 Else
  MsgBox "请填写内容!", vbOKOnly, "提示:"
End If
tt3.Text = ""
End Sub

Private Sub Command2_Click()
     Dim xname As String
     xname = Form3.txtname.Text
     cnnUser.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
     "Data Source=" & App.Path & "\db.mpp;" & _
     "Mode= ReadWrite | Share Deny None"
     cnnUser.Open
     With rstUser
     Set .ActiveConnection = cnnUser
    .CursorType = adOpenKeyset  'adOpenKeyset,adOpenStatic可使用Recordset的RecordCount,其他两个属性不行
     End With
     With rstUser
     If .State = adOpenKeyset Then .Close
     .Open "select * from [admin] where [name]='" & xname & "'", cnnUser, adOpenKeyset, adLockOptimistic

     If Not .EOF Then
        If decipher(rstUser.Fields("password").Value) <> Form3.txtyuan.Text Then
           MsgBox "原密码不正确!", vbOKOnly, "错误:"
           cnnUser.Close
           txtyuan.Text = ""
           Exit Sub
        End If
     Else

⌨️ 快捷键说明

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