?? 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 + -