📄 xiugai.frm
字号:
VERSION 5.00
Begin VB.Form xiugai
Caption = "修改"
ClientHeight = 4155
ClientLeft = 60
ClientTop = 450
ClientWidth = 4740
LinkTopic = "Form2"
ScaleHeight = 4155
ScaleWidth = 4740
StartUpPosition = 3 '窗口缺省
Begin VB.CheckBox Check2
Caption = "女 "
Height = 375
Left = 2880
TabIndex = 12
Top = 2400
Width = 855
End
Begin VB.CheckBox Check1
Caption = "男"
Height = 375
Left = 1800
TabIndex = 11
Top = 2400
Width = 855
End
Begin VB.TextBox Text5
Height = 390
Left = 1920
TabIndex = 9
Top = 720
Width = 1935
End
Begin VB.CommandButton Command1
Caption = "修改"
Height = 495
Left = 840
TabIndex = 8
Top = 3120
Width = 975
End
Begin VB.CommandButton Command2
Caption = "返回"
Height = 495
Left = 2640
TabIndex = 7
Top = 3120
Width = 855
End
Begin VB.TextBox Text1
Height = 375
Left = 1920
TabIndex = 2
Top = 240
Width = 1935
End
Begin VB.TextBox Text2
Height = 375
Left = 1920
TabIndex = 1
Top = 1200
Width = 1935
End
Begin VB.TextBox Text3
Height = 375
Left = 1920
TabIndex = 0
Top = 1800
Width = 1935
End
Begin VB.Label Label2
Caption = "请输入新密码:"
Height = 255
Left = 360
TabIndex = 10
Top = 840
Width = 1215
End
Begin VB.Label Label1
Caption = "输入要修改的账号"
Height = 255
Left = 240
TabIndex = 6
Top = 360
Width = 1455
End
Begin VB.Label Label3
Caption = "姓名:"
Height = 255
Left = 480
TabIndex = 5
Top = 1320
Width = 975
End
Begin VB.Label Label4
Caption = "年龄:"
Height = 255
Left = 480
TabIndex = 4
Top = 1800
Width = 975
End
Begin VB.Label Label5
Caption = "性别:"
Height = 255
Left = 480
TabIndex = 3
Top = 2400
Width = 975
End
End
Attribute VB_Name = "xiugai"
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
'MsgBox "t2=" & rss1.RecordCount
'If rss1.RecordCount <= 0 Then
'MsgBox "t1=" & Text1.Text
'MsgBox "t2=" & rss.RecordCount
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
rss2("姓名") = Text2.Text
rss2("年龄") = Text3.Text
If Check1.Value = 1 Then
rss2("性别") = "男"
ElseIf Check2.Value = 1 Then
rss2("性别") = "女"
End If
rss2.Update
MsgBox "修改成功"
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text5.Text = ""
Check1.Value = 0
Check2.Value = 0
Exit Sub
Else
rss2.MoveNext
End If
Loop
MsgBox "您输入的帐号有误或不存在此帐户,请重新输入!", vbOKOnly + vbExclamation, "银行系统提示"
Text1.Text = ""
Text1.SetFocus
'Else
'Call connectDB1
'adoRS1.Open "admin_05_10", adoCon1
'adoRS1("姓名") = ""
'adoRS1("年龄") = ""
'adoRS1("性别") = ""
'If Not adoRS Then
'adoRS1.AddNew
'adoRS1("姓名") = Text2.Text
'adoRS1("年龄") = Text3.Text
'If Check1.Value = 1 Then
'adoRS1("性别") = "男"
'ElseIf Check2.Value = 1 Then
'adoRS1("性别") = "女"
'End If
''adoRS1.MoveNext
'MsgBox "修改成功"
'Text1.Text = ""
'Text2.Text = ""
'Text3.Text = ""
'Text5.Text = ""
'Check1.Value = 0
'Check2.Value = 0
'End If
'End If
End Sub
Private Sub Command2_Click()
guanli.Show
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -