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

📄 chaxun.frm

📁 数据库银行管理系统数据库银行管理系统数据库银行管理系统
💻 FRM
字号:
VERSION 5.00
Begin VB.Form chaxun 
   Caption         =   "查询"
   ClientHeight    =   5535
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   5265
   LinkTopic       =   "Form2"
   ScaleHeight     =   5535
   ScaleWidth      =   5265
   StartUpPosition =   3  '窗口缺省
   Begin VB.TextBox Text6 
      Enabled         =   0   'False
      Height          =   375
      Left            =   1800
      TabIndex        =   13
      Top             =   840
      Visible         =   0   'False
      Width           =   735
   End
   Begin VB.TextBox Text5 
      Enabled         =   0   'False
      Height          =   375
      Left            =   1800
      TabIndex        =   11
      Top             =   3120
      Width           =   1455
   End
   Begin VB.CommandButton Command2 
      Caption         =   "返回"
      Height          =   495
      Left            =   2760
      TabIndex        =   9
      Top             =   3960
      Width           =   855
   End
   Begin VB.CommandButton Command1 
      Caption         =   "查询"
      Height          =   495
      Left            =   960
      TabIndex        =   8
      Top             =   3960
      Width           =   975
   End
   Begin VB.TextBox Text4 
      Enabled         =   0   'False
      Height          =   375
      Left            =   1800
      TabIndex        =   7
      Top             =   2520
      Width           =   735
   End
   Begin VB.TextBox Text3 
      Enabled         =   0   'False
      Height          =   375
      Left            =   1800
      TabIndex        =   6
      Top             =   2040
      Width           =   1935
   End
   Begin VB.TextBox Text2 
      Enabled         =   0   'False
      Height          =   375
      Left            =   1800
      TabIndex        =   5
      Top             =   1440
      Width           =   1935
   End
   Begin VB.TextBox Text1 
      Height          =   375
      Left            =   1800
      TabIndex        =   1
      Top             =   360
      Width           =   1935
   End
   Begin VB.Label Label6 
      Caption         =   "编号:"
      Height          =   375
      Left            =   360
      TabIndex        =   12
      Top             =   960
      Visible         =   0   'False
      Width           =   1095
   End
   Begin VB.Label Label2 
      Caption         =   "权限:"
      Height          =   375
      Left            =   360
      TabIndex        =   10
      Top             =   3120
      Width           =   975
   End
   Begin VB.Label Label5 
      Caption         =   "性别:"
      Height          =   375
      Left            =   360
      TabIndex        =   4
      Top             =   2520
      Width           =   975
   End
   Begin VB.Label Label4 
      Caption         =   "年龄:"
      Height          =   255
      Left            =   360
      TabIndex        =   3
      Top             =   2040
      Width           =   975
   End
   Begin VB.Label Label3 
      Caption         =   "姓名:"
      Height          =   375
      Left            =   360
      TabIndex        =   2
      Top             =   1440
      Width           =   975
   End
   Begin VB.Label Label1 
      Caption         =   "输入要查询的账号"
      Height          =   255
      Left            =   120
      TabIndex        =   0
      Top             =   480
      Width           =   1455
   End
End
Attribute VB_Name = "chaxun"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()


    If Text1.Text = "" Then
      MsgBox "请输入您要操作的帐号!", vbExclamation + vbOKOnly, "银行系统提示"
      Text1.Text = ""
      Text1.SetFocus
      Exit Sub
    End If
    

Dim SQL As String
Set adoCon1 = New ADODB.Connection
adoCon1.Open "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=bank;Data Source=B14"
                                                                   '与SQL后台数据库建立连接
SQL = "select count(*) from admin_05_10 where name='" & Trim(Text1.Text) & "' "

Set adoRS1 = adoCon1.Execute(SQL)
If adoRS1(0) = 0 Then


Dim cn2 As ADODB.Connection
Set cn2 = New ADODB.Connection
cn2.Open "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=bank;Data Source=B14"
Dim rss2 As ADODB.Recordset
Set rss2 = New ADODB.Recordset
strsql22 = "select * from id_05_10 where name='" & Trim(Text1.Text) & "'"
rss2.Open strsql22, cn2, adOpenKeyset, adLockOptimistic
Do While Not rss2.EOF
    If Trim(rss2!Name) = Trim(Text1.Text) Then
         Label6.Visible = True
         Text6.Visible = True
         Text6.Text = rss2("编号")
         Text2.Text = rss2("姓名")
         Text3.Text = rss2("年龄")
         Text4.Text = rss2("性别")
         Text5.Text = "操作员"
         MsgBox "查询成功!"
         Exit Sub
     Else
         rss2.MoveNext
     End If
 Loop
 MsgBox "您输入的帐号有误或不存在此帐户,请重新输入!", vbOKOnly + vbExclamation, "银行系统提示"
Text1.Text = ""
Text1.SetFocus
Else

Label6.Visible = False
Text6.Visible = False

  Call connectDB1
  adoRS1.Open "admin_05_10", adoCon1

   Text2.Text = adoRS1("姓名")
   Text3.Text = adoRS1("年龄")
   Text4.Text = adoRS1("性别")
   Text5.Text = "管理员"
   MsgBox "查询成功!"
End If
End Sub

Private Sub Command2_Click()
guanli.Show
Unload Me

End Sub

⌨️ 快捷键说明

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