📄 fetch1.frm
字号:
VERSION 5.00
Begin VB.Form fetch1
Caption = "取款"
ClientHeight = 4110
ClientLeft = 60
ClientTop = 450
ClientWidth = 6735
LinkTopic = "Form1"
ScaleHeight = 4110
ScaleWidth = 6735
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text1
Height = 270
IMEMode = 3 'DISABLE
Index = 3
Left = 2040
PasswordChar = "*"
TabIndex = 9
Top = 2640
Width = 2535
End
Begin VB.TextBox Text1
Height = 270
IMEMode = 3 'DISABLE
Index = 2
Left = 2040
PasswordChar = "*"
TabIndex = 8
Top = 2160
Width = 2535
End
Begin VB.TextBox Text1
Height = 270
Index = 1
Left = 2040
TabIndex = 7
Top = 1680
Width = 2535
End
Begin VB.TextBox Text1
Height = 270
Index = 0
Left = 2040
TabIndex = 6
Top = 1200
Width = 2535
End
Begin VB.CommandButton Command2
Caption = "取消"
Height = 375
Left = 3600
TabIndex = 5
Top = 3240
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 375
Left = 1680
TabIndex = 4
Top = 3240
Width = 1095
End
Begin VB.Label Label5
Caption = "取款金额:"
Height = 255
Left = 960
TabIndex = 10
Top = 1680
Width = 975
End
Begin VB.Label Label4
Caption = "再次输入密码:"
Height = 255
Left = 720
TabIndex = 3
Top = 2640
Width = 1335
End
Begin VB.Label Label3
Caption = "请输入密码:"
Height = 255
Left = 840
TabIndex = 2
Top = 2160
Width = 1095
End
Begin VB.Label Label2
Caption = "请输入帐号:"
Height = 255
Left = 840
TabIndex = 1
Top = 1200
Width = 1215
End
Begin VB.Label Label1
Alignment = 2 'Center
Caption = "取款"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1800
TabIndex = 0
Top = 360
Width = 3135
End
End
Attribute VB_Name = "fetch1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim str As String
Dim input1 As Boolean
input1 = False
str = "select * from account"
Set cn = New adodb.Connection
Dim rst As Recordset
Set rst = New Recordset
Dim dat1 As Date
Dim dat2 As Date
Dim lastmoney As Double
cn.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=bank;Data Source=(local)"
cn.Open
rst.Open str, cn, adOpenDynamic, adLockOptimistic
'''''''''''''''''''''''''''
'保证不为空
''''''''''''''''''''''''''
For i = 0 To 3
If Text1(i).Text = "" Then
MsgBox "请把数据全部填上!"
Exit Sub
End If
Next i
''''''''''''''''''''''''''
'查找此帐号
'''''''''''''''''''''''''
If Text1(2).Text <> Text1(3).Text Then
MsgBox "两次输入密码不一致"
rst.Close
cn.Close
Exit Sub
End If
rst.MoveFirst
Do While Not rst.EOF
If Trim(rst!AuserID) = Text1(0).Text And Trim(rst!Apassword) = Text1(2).Text Then
input1 = True
GoTo AAA
End If
rst.MoveNext
Loop
MsgBox "查无此帐号!请重新输入!"
rst.Close
cn.Close
Exit Sub
''''''''''''''''''''''
'算出时间
''''''''''''''''''''
AAA:
dat1 = Format(Date, yyyy, mm, dd)
dat2 = DateDiff("m", rst!lastdate, dat1)
'''''''''''''''''''''''''''
'算出所得利息
'''''''''''''''''''''''''''
permoney = CDbl(rst!percentage) * dat2
If (CDbl(rst!Endmoney) + permoney) < CDbl(Text1(0).Text) Then
MsgBox "现您的帐户没有这么多余额,请查询余额!"
rst.Close
cn.Close
Exit Sub
Else
lastmoney = CDbl(rst!Endmoney) + permoney - CDbl(Text1(0).Text)
End If
''''''''''''''''''''''''''
'插入信息
'''''''''''''''''''''''''
rst.Fields("Endmoney") = lastmoney
rst.Fields("lastdate") = dat1
rst.Update
rst.Close
cn.Close
MsgBox "取款成功!"
Unload Me
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -