【VB开源代码栏目提醒】:以下是网学会员为您推荐的VB开源代码-frmInputBoxFetch.frm,希望本篇文章对您学习有所帮助。
VERSION 5.00
Begin VB.Form frmIBF
BackColor = &H00FF8080&
BorderStyle = 1 'Fixed Single
Caption = "请输入密码!"
ClientHeight = 1980
ClientLeft = 45
ClientTop = 435
ClientWidth = 7590
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 1980
ScaleWidth = 7590
Begin VB.TextBox txt
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 270
IMEMode = 3 'DISABLE
Left = 120
PasswordChar = "*"
TabIndex = 0
Top = 1560
Width = 7335
End
Begin VB.CommandButton cmdOK
Caption = "确 定"
Default = -1 'True
Height = 345
Left = 6480
TabIndex = 1
Top = 240
Width = 975
End
Begin VB.CommandButton cmdCancel
Cancel = -1 'True
Caption = "取 消"
Height = 345
Left = 6480
TabIndex = 2
Top = 840
Width = 975
End
Begin
VB.Label lbl
AutoSize = -1 'True
BackColor = &H00404040&
Caption = "请输入密码!"
ForeColor = &H00FFFFFF&
Height = 180
Left = 240
TabIndex = 3
Top = 240
Width = 1080
End
End
Attribute VB_Name = "frmIBF"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rst As Recordset
Public consumerID As String
Public consumerMoney As Double
Public nowDate As String
Public nowTime As String
Public balance As Double
Public DDate As String
Public passTime As Double
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdOK_Click()
'设置数据集对象rst
Set rst = New Recordset
'判断输入的帐户密码是否为空
If Len(txt.Text) = 0 Then
'输入的帐户密码为空,给出错误提示
MsgBox "密码不能为空!"
Exit Sub
End If
'调用LinkDB函数设置
登陆数据库服务器时的身份验证方式
Call LinkDB(landWay, SName, "yinhang", SUName, SUPw)
'连接数据库yinhang
con.Open
'重新设置数据集对象rst,以返回CConsumers表中的所有账户账号
rst.Open "select * from CConsumers where id='" & consumerID & "'", con, _
adOpenDynamic, adLockOpti
mistic
'判断输入的帐户密码是否正确
If txt.Text = rst!pass
word Then
'输入的帐户密码正确
'执行
sql语句,在与该账户账号对应的操作表中插入此次取款操作记录
con.Execute "insert " & consumerID & " values('" & nowDate & "','get','" & _
consumerMoney & "','" & _
(balance) * (1 + (passTime * ((percentage0 / 100) / 12))) - consumerMoney & _
"','" & userName & "')"
con.Close
'弹出提示框,要求确认是否打印存根
If MsgBox("取款成功,请问是否需要打印存根?", vbOKCancel, "提示") = vbOK Then
'在窗体中设置此次储户存款存根中的储蓄账户账号
frmPrintFetch.lbl(1).Caption = consumerID
'在窗体中设置此次储户存款存根中的取款金额
frmPrintFetch.lbl(3).Caption = consumerMoney
'在窗体中设置此次储户存款存根中的帐户余额
frmPrintFetch.lbl(4).Caption = balance - consumerMoney
'在窗体中设置此次储户存款存根中的取款日期
frmPrintFetch.lbl(5).Caption = nowTime
'在窗体中设置此次储户存款存根中的信用社手续员
frmPrintFetch.lbl(6).Caption = userName
'调用frmPrintFetch窗体的PrintForm方法打印储户存款存根
frmPrintFetch.PrintForm
'卸载窗体frmPrintDeposit
Unload frmPrintFetch
End If
'弹出对话框“取款完成”,提示取款完成
MsgBox "取款完成"
'卸载frmIBF窗体
Unload Me
'卸载窗体,完成此次取款操作
Unload frmFetch
Else
'输入的帐户密码不正确,给出错误提示
MsgBox "密码不正确!"
Exit Sub
End If
End Sub