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

📄 zyzj.frm

📁 这个就不用多说了
💻 FRM
字号:
VERSION 5.00
Begin VB.Form ZYZJ 
   BackColor       =   &H80000004&
   Caption         =   "国有资产"
   ClientHeight    =   2670
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   5805
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   ScaleHeight     =   2670
   ScaleWidth      =   5805
   StartUpPosition =   2  '屏幕中心
   Begin VB.CommandButton Command1 
      Caption         =   "保存"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   2535
      TabIndex        =   7
      Top             =   2190
      Width           =   1035
   End
   Begin VB.CommandButton Command2 
      Caption         =   "退出"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   4065
      TabIndex        =   8
      Top             =   2220
      Width           =   1050
   End
   Begin VB.Frame Frame1 
      Height          =   2070
      Left            =   60
      TabIndex        =   0
      Top             =   15
      Width           =   5655
      Begin VB.TextBox Text3 
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         IMEMode         =   3  'DISABLE
         Left            =   1935
         PasswordChar    =   "*"
         TabIndex        =   3
         Top             =   1410
         Width           =   2625
      End
      Begin VB.TextBox Text2 
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         IMEMode         =   3  'DISABLE
         Left            =   1935
         PasswordChar    =   "*"
         TabIndex        =   2
         Top             =   870
         Width           =   2625
      End
      Begin VB.TextBox Text1 
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   1935
         TabIndex        =   1
         Top             =   330
         Width           =   2625
      End
      Begin VB.Image Image2 
         Height          =   480
         Left            =   1140
         Picture         =   "ZYZJ.frx":0000
         Top             =   1200
         Width           =   480
      End
      Begin VB.Image Image1 
         Height          =   480
         Left            =   1185
         Picture         =   "ZYZJ.frx":0442
         Top             =   330
         Width           =   480
      End
      Begin VB.Label Label2 
         Caption         =   "确认密码"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   180
         TabIndex        =   6
         Top             =   1500
         Width           =   1455
      End
      Begin VB.Label Label1 
         Caption         =   "输入密码"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   165
         TabIndex        =   5
         Top             =   930
         Width           =   900
      End
      Begin VB.Label d 
         Caption         =   "输入名称"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   180
         TabIndex        =   4
         Top             =   375
         Width           =   855
      End
   End
End
Attribute VB_Name = "ZYZJ"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim conn As New ADODB.Connection
Dim mycommand As New ADODB.Command
Dim rst As New ADODB.Recordset
Public statr As String
Private Sub Command1_Click()

On Error GoTo err:
If Text2.Text <> Text3.Text Then
MsgBox "两次输入不一样", vbInformation, "提示"
Exit Sub
End If
If Text1.Text = "" Then
MsgBox "名字不能为空", vbInformation, "提示"
Exit Sub
End If
If conn.state = 0 Then
         conn.ConnectionString = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=SYS"
         conn.Open
        End If
        mycommand.ActiveConnection = conn
        If statr = "Add" Then
        mycommand.CommandText = "insert MyUser (UserName,Pword) values(" & "'" & Text1.Text & "'" & "," & "'" & Text3.Text & "'" & ")"
        End If
        If statr = "Edit" Then
        mycommand.CommandText = "update MyUser set UserName=" & "'" & Text1.Text & "'" & "," & "Pword=" & " '" & Text3.Text & "'" & " where ID=" & Text1.Tag
        End If
        mycommand.Execute
        conn.Close
        Unload Me
Exit Sub
err:
MsgBox (err.Description)
        
        
End Sub

Private Sub Command2_Click()
Unload Me
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text2.SetFocus
End If
End Sub

Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text3.SetFocus
End If
End Sub

⌨️ 快捷键说明

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