📄 newaccount3.frm
字号:
VERSION 5.00
Begin VB.Form newaccount3
Caption = "开户3"
ClientHeight = 3555
ClientLeft = 60
ClientTop = 450
ClientWidth = 7605
LinkTopic = "Form1"
ScaleHeight = 3555
ScaleWidth = 7605
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text1
Height = 270
IMEMode = 3 'DISABLE
Index = 1
Left = 2040
PasswordChar = "*"
TabIndex = 9
Top = 2145
Width = 2295
End
Begin VB.TextBox Text1
Height = 270
IMEMode = 3 'DISABLE
Index = 0
Left = 2040
PasswordChar = "*"
TabIndex = 8
Top = 1545
Width = 2295
End
Begin VB.CommandButton Command2
Caption = "取消"
Height = 375
Left = 3960
TabIndex = 7
Top = 2760
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 375
Left = 1800
TabIndex = 6
Top = 2760
Width = 1095
End
Begin VB.Label Label6
Alignment = 2 'Center
Caption = "密码不能超过12位"
Height = 375
Left = 2640
TabIndex = 5
Top = 960
Width = 2175
End
Begin VB.Label Label5
Caption = "再次输入密码:"
Height = 255
Left = 600
TabIndex = 4
Top = 2160
Width = 1335
End
Begin VB.Label Label4
Caption = "用户密码输入:"
Height = 255
Left = 600
TabIndex = 3
Top = 1560
Width = 1335
End
Begin VB.Label Label3
Caption = "请用户输入密码!"
BeginProperty Font
Name = "宋体"
Size = 18
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 2280
TabIndex = 2
Top = 240
Width = 3015
End
Begin VB.Label Label2
Caption = "最后一步"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 6000
TabIndex = 1
Top = 840
Width = 1215
End
Begin VB.Label Label1
Caption = "Finally"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 240
TabIndex = 0
Top = 720
Width = 1335
End
End
Attribute VB_Name = "newaccount3"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Aname1 As String '用户名
Public ApeopleID1 As String '用户身份证号
Public Aaddress1 As String '用户地址
Public Aphone1 As String '用户电话号码
Public money1 As String '用户存款
Public AuserID1 As String '用户帐号
Public date1 As Date '存款日期
Private Sub Command1_Click()
Dim str1 As String
Dim str2 As String
Dim str3 As String
str1 = "select * from Ausers"
str2 = "select * from account"
str3 = "select * from percen"
Set cn = New adodb.Connection
Dim rst1 As Recordset
Dim rst2 As Recordset
Dim rst3 As Recordset
Set rst1 = New Recordset
Set rst2 = New Recordset
Set rst3 = New Recordset
cn.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=bank;Data Source=(local)"
cn.Open
rst1.Open str1, cn, adOpenDynamic, adLockOptimistic
rst2.Open str2, cn, adOpenDynamic, adLockOptimistic
rst3.Open str3, cn, adOpenDynamic, adLockOptimistic
If Text1(0).Text = "" Or Text1(1).Text = "" Then '如果密码为空,重新输入
MsgBox "请输入密码,密码不能为空!"
Exit Sub
End If
If Len(Text1(0).Text) > 12 Or Len(Text1(1).Text) > 12 Then '如果密码长于12位
MsgBox "密码不得长于12位"
Exit Sub
End If
If Text1(0).Text = Text1(1).Text Then
'''''''''''''''''''''''''''''''
'向数据库插入数据
''''''''''''''''''''''''''''''''
rst1.AddNew
rst1.Fields("Aname") = Aname1
rst1.Fields("AuserID") = AuserID1
rst1.Fields("address") = Aaddress1
rst1.Fields("phone") = Aphone1
rst1.Fields("peopleID") = ApeopleID1
rst1.Update
rst2.AddNew
rst2.Fields("Aname") = Aname1
rst2.Fields("AuserID") = AuserID1
rst2.Fields("Apassword") = Text1(1).Text
rst2.Fields("endmoney") = money1
rst2.Fields("lastdate") = date1
rst2.Fields("ID") = sid
rst2.Fields("percentage") = rst3!percentage
rst2.Update
Unload Me
MsgBox ("开户成功,谢谢惠顾!")
Else
MsgBox ("你输入的两次密码不一致!请重新输入")
Text1(0).Text = ""
Text1(1).Text = ""
newaccount3.Refresh
End If
rst1.Close
rst2.Close
rst3.Close
cn.Close
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -