📄 form15.frm
字号:
VERSION 5.00
Begin VB.Form Form15
BackColor = &H00FFFFFF&
Caption = "消户"
ClientHeight = 5865
ClientLeft = 60
ClientTop = 435
ClientWidth = 7995
BeginProperty Font
Name = "楷体_GB2312"
Size = 15
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
LinkTopic = "Form15"
Picture = "Form15.frx":0000
ScaleHeight = 5865
ScaleWidth = 7995
StartUpPosition = 3 'Windows Default
Begin VB.CommandButton Command1
BackColor = &H00C0E0FF&
Caption = "确定"
Height = 615
Left = 1080
Style = 1 'Graphical
TabIndex = 10
Top = 4920
Width = 2055
End
Begin VB.CommandButton Command2
BackColor = &H00C0E0FF&
Caption = "退出"
Height = 615
Left = 4680
Style = 1 'Graphical
TabIndex = 9
Top = 4920
Width = 2055
End
Begin VB.Frame Frame1
BackColor = &H00FFC0C0&
Caption = "消户"
Height = 3975
Left = 600
TabIndex = 0
Top = 480
Width = 6855
Begin VB.TextBox Text1
Height = 495
Left = 2880
TabIndex = 4
Top = 480
Width = 3135
End
Begin VB.TextBox Text2
Height = 495
IMEMode = 3 'DISABLE
Left = 2880
PasswordChar = "*"
TabIndex = 3
Top = 1320
Width = 3135
End
Begin VB.TextBox Text3
Height = 495
IMEMode = 3 'DISABLE
Left = 2880
PasswordChar = "*"
TabIndex = 2
Top = 2160
Width = 3135
End
Begin VB.TextBox Text4
Height = 495
Left = 2880
TabIndex = 1
Top = 3000
Width = 3135
End
Begin VB.Label Label1
Alignment = 2 'Center
BackColor = &H00C0E0FF&
Caption = "卡号"
Height = 495
Left = 240
TabIndex = 8
Top = 480
Width = 1695
End
Begin VB.Label Label2
Alignment = 2 'Center
BackColor = &H00C0E0FF&
Caption = "密码"
Height = 495
Left = 240
TabIndex = 7
Top = 1320
Width = 1695
End
Begin VB.Label Label3
Alignment = 2 'Center
BackColor = &H00C0E0FF&
Caption = "密码确认"
Height = 495
Left = 240
TabIndex = 6
Top = 2160
Width = 1695
End
Begin VB.Label Label4
Alignment = 2 'Center
BackColor = &H00C0E0FF&
Caption = "身份证号"
Height = 495
Left = 240
TabIndex = 5
Top = 3000
Width = 1695
End
End
End
Attribute VB_Name = "Form15"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim con As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim rst As New ADODB.Recordset
Dim rst1 As New ADODB.Recordset
Dim rst2 As New ADODB.Recordset
Dim rst3 As New ADODB.Recordset
Dim rst4 As New ADODB.Recordset
Dim rst5 As New ADODB.Recordset
Private Sub Command1_Click()
Dim hello
con.Open "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=wuhao"
If Text1.Text = "" Then
MsgBox "卡号不能为空!"
Text1.SetFocus
ElseIf Text2.Text = "" Then
MsgBox "密码不能为空!"
Text2.SetFocus
ElseIf Text3.Text = "" Then
MsgBox "密码不能为空!"
Text3.SetFocus
ElseIf Text4.Text = "" Then
MsgBox "身份证号不能为空!"
Text4.SetFocus
ElseIf Len(Text1.Text) > 15 Then
MsgBox "卡号不得大于15位"
Text1.SetFocus
ElseIf Len(Text2.Text) > 10 Then
MsgBox "密码不得大于10位"
Text2.SetFocus
ElseIf Len(Text3.Text) > 15 Then
MsgBox "密码不得大于10位"
Text3.SetFocus
ElseIf Len(Text4.Text) > 20 Then
MsgBox "身份证号码不得长于20位"
Text4.SetFocus
ElseIf Text2.Text <> Text3.Text Then
MsgBox "两次输入的密码不一致,请重新输入"
Text2.SetFocus
Else
rst.Open "select * from account_xx053_19 where account_id='" & Trim(Text1.Text) & "'and password='" & Trim(Text2.Text) & "'and customer_id='" & Trim(Text4.Text) & "'", con, adOpenKeyset, adLockOptimistic
If (rst.EOF) Then
MsgBox "帐号或密码或身份证号错误,请重新输入", vbExclamation, "信息错误"
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text1.SetFocus
rst.Close
Else
hello = rst.Sort
rst.MoveLast
MsgBox "信息正确", vbExclamation
If rst.Fields(3) >= 10 Then
MsgBox "仍有余额,请确认后再消户!", vbExclamation
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text1.SetFocus
rst.Close
Else
If MsgBox("您确定要删除该帐号码?", vbExclamation + vbOKCancel, "系统提示") = vbOK Then
rst2.Open "delete from in_xx053_19 where account_id='" & Trim(Text1.Text) & "'", con, adOpenKeyset, adLockOptimistic
' rst2.Close
rst3.Open "Delete from out_xx053_19 where account_id='" & Trim(Text1.Text) & "'", con, adOpenKeyset, adLockOptimistic
' rst3.Close
rst4.Open "Delete from ammount_xx053_19 where ammount_id='" & Trim(Text1.Text) & "'or account_id='" & Trim(Text1.Text) & "' ", con, adOpenKeyset, adLockOptimistic
' rst4.Close
rst5.Open "Delete from loss_xx053_19 where account_id='" & Trim(Text1.Text) & "' ", con, adOpenKeyset, adLockOptimistic
' rst5.Close
' rst1.Open "Delete from customer_xx053_19 where customer_id='" & Trim(Text4.Text) & "'", con, adOpenKeyset, adLockOptimistic
'rst1.Close
rs.Open "Delete from account_xx053_19 where account_id='" & Trim(Text1.Text) & "'", con, adOpenKeyset, adLockOptimistic
'rs.Close
MsgBox "消户成功"
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text1.SetFocus
' Command2.SetFocus
End If
rst.Close
End If
End If
con.Close
End If
End Sub
Private Sub Command2_Click()
Unload Me
Form4.Show
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -