📄 取款界面.frm
字号:
VERSION 5.00
Begin VB.Form Frmget
Caption = "取款操作窗口"
ClientHeight = 4815
ClientLeft = 60
ClientTop = 345
ClientWidth = 6555
LinkTopic = "Form4"
ScaleHeight = 4815
ScaleWidth = 6555
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Txtname
Height = 375
Left = 3120
TabIndex = 1
Top = 2040
Width = 2055
End
Begin VB.CommandButton ComQuit
Caption = "返回到主界面"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 3720
TabIndex = 3
Top = 3360
Width = 1815
End
Begin VB.CommandButton ComOk
Caption = "确认取款"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 960
TabIndex = 2
Top = 3360
Width = 1935
End
Begin VB.Label Label2
Alignment = 2 'Center
Caption = "银行模拟系统——取款界面"
BeginProperty Font
Name = "宋体"
Size = 21.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 0
TabIndex = 4
Top = 0
Width = 6375
End
Begin VB.Label Label5
Caption = "请输入您的取款金额:"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 480
TabIndex = 0
Top = 1200
Width = 3375
End
End
Attribute VB_Name = "Frmget"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub ComOk_Click()
'On Error GoTo ErrMsg
'Call connectDB
Dim cn As ADODB.Connection
Dim cn1 As ADODB.Connection
Set cn = New ADODB.Connection
Set cn1 = New ADODB.Connection
'Dim cn2 As ADODB.Connection
'Set cn2 = New ADODB.Connection
cn.Open "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=bank;Data Source=B14"
cn1.Open "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=bank;Data Source=B14"
'cn2.Open "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=bank;Data Source=LXL-C5626F0E7F4"
Dim rss As ADODB.Recordset
Set rss = New ADODB.Recordset
Dim rss1 As ADODB.Recordset
Set rss1 = New ADODB.Recordset
'Dim rss2 As ADODB.Recordset
'Set rss2 = New ADODB.Recordset
strsql = "select * from zhanghu_05_10 where 卡号='" & strr & "'"
strsql1 = "select * from id_05_10 where name='" & strr1 & "'"
rss.Open strsql, cn, adOpenKeyset, adLockOptimistic
rss1.Open strsql1, cn1, adOpenKeyset, adLockOptimistic
Do While Not rss.EOF
If rss("余额") - Val(TxtName.Text) < 0 Then
TxtName.Text = ""
MsgBox "余额不足!", vbExclamation + vbOKOnly, "银行系统提示"
Exit Sub
ElseIf (TxtName.Text) = "" Then
MsgBox "你没有输入取款金额!", vbExclamation + vbOKOnly, "银行系统提示"
TxtName.Text = ""
TxtName.SetFocus
Else
rss("余额") = rss("余额") - Val(TxtName.Text)
rss.Update
End If
MsgBox "您的取款完成,请返回界面!", vbOKOnly + vbInformation, "银行系统提示"
rss.MoveNext
Loop
Call connectDB1
adoRS1.Open "get_05_10", adoCon1
If Not adoRS1 Then
adoRS1.AddNew
adoRS1("卡号") = strr
adoRS1("编号") = rss1("编号")
adoRS1("取款额") = Trim(TxtName.Text)
'Dim time As String
'time=format(sysdate,"yyyy/mm/dd")
'aaa = Trim(Now)
adoRS1("取款时间") = Trim(Now)
adoRS1.Update
adoRS1.MoveNext
End If
ErrMsg:
If Err.Number <> 0 Then
MsgBox CStr(Err.Number) + Err.Description, vbOKOnly + vbCritical, "银行系统错误提示"
Exit Sub
End If
End Sub
Private Sub ComQuit_Click()
Frmget.Hide
Frmmain.Show
End Sub
Private Sub Form_Load()
On Error GoTo ErrMsg
TxtName.Text = ""
ErrMsg:
If Err.Number <> 0 Then
MsgBox Err.Number & Err.Description, vbOKOnly + vbCritical, "银行系统错误提示"
Exit Sub
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -