【VB开源代码栏目提醒】:网学会员为需要VB开源代码的朋友们搜集整理了frmFetch.frm相关资料,希望对各位网友有所帮助!
VERSION 5.00
Begin VB.Form frmFetch
BackColor = &H00FF8080&
BorderStyle = 1 'Fixed Single
Caption = "取款"
ClientHeight = 3120
ClientLeft = 45
ClientTop = 435
ClientWidth = 5415
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 3120
ScaleWidth = 5415
Begin VB.CommandButton cmdCancel
Cancel = -1 'True
Caption = "取 消"
Height = 345
Left = 3240
TabIndex = 5
Top = 2520
Width = 975
End
Begin VB.CommandButton cmdFinally
Caption = "完 成"
Default = -1 'True
Height = 345
Left = 1920
TabIndex = 4
Top = 2520
Width = 975
End
Begin VB.TextBox txt
Appearance = 0 'Flat
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
IMEMode = 3 'DISABLE
Index = 0
Left = 2280
TabIndex = 1
Top = 960
Width = 2415
End
Begin VB.TextBox txt
Appearance = 0 'Flat
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
IMEMode = 3 'DISABLE
Index = 1
Left = 2280
TabIndex = 2
Top = 1440
Width = 2415
End
Begin VB.TextBox txt
Appearance = 0 'Flat
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
IMEMode = 3 'DISABLE
Index = 2
Left = 2280
TabIndex = 3
Top = 1920
Width = 2415
End
Begin VB.Label lbl
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "请输入帐户号码:"
ForeColor = &H00FFFFFF&
Height = 180
Index = 4
Left = 720
TabIndex = 8
Top = 1080
Width = 1440
End
Begin
VB.Label lbl
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "请输入取款金额:"
ForeColor = &H00FFFFFF&
Height = 180
Index = 1
Left = 720
TabIndex = 7
Top = 1560
Width = 1440
End
Begin VB.Label lbl
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "请再次输入取款金额:"
ForeColor = &H00FFFFFF&
Height = 180
Index = 3
Left = 360
TabIndex = 6
Top = 2040
Width = 1800
End
Begin VB.Label lbl
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "取款"
BeginProperty Font
Name = "华文新魏"
Size = 15.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 315
Index = 2
Left = 2640
TabIndex = 0
Top = 240
Width = 630
End
Begin VB.Line line
BorderColor = &H00FFFFFF&
BorderWidth = 2
X1 = 360
X2 = 5040
Y1 = 600
Y2 = 600
End
End
Attribute VB_Name = "frmFetch"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'定义存储取款金额的模块级变量
Dim money As Double
'定义存储账户余额的模块级变量
Dim balance As Double
'定义数据集对象
Dim rst As Recordset
'定义存储储户密码的模块级变量
Dim pass
word As String
'定义数据集对象
Dim i As Integer
'定义数据集对象
Dim nowDate As String
'定义数据集对象
Dim DDate As String
'定义数据集对象
Dim nowTime As String
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdFinally_Click()
'设置数据集对象rst
Set rst = New Recordset
'在临时变量nowTime中存储当前日期和时间
nowTime = Now
'在临时变量nowDate中存储格式化后的当前日期和时间
nowDate = Format(nowTime, "yyyy") + Format(nowTime, "mm") + Format(nowTime, "dd") _
+ Format(nowTime, "hh") + Format(nowTime, "nn") + Format(nowTime, "ss")
''''''''''''''''''''''''''''''''''''取款金额的正确性↓
'判断两次输入的取款金额是否一致
If txt(1) <> txt(2) Then
MsgBox "请确定两次输入的取款金额相同!"
Exit Sub
End If
Dim getErr As Boolean
getErr = True
On Error GoTo errMoney
'利用CDbl函数将用户输入的存款金额的数据类型转换为Double数据类型
money = CDbl(txt(1).Text)
getErr = False
errMoney:
If getErr = True Then
'两次输入的用户取款额不一致,给出错误提示
MsgBox "请确定您所输入的金额是数值!"
Exit Sub
End If
'调用LinkDB函数设置
登陆数据库服务器时的身份验证方式
Call LinkDB(landWay, SName, "yinhang", SUName, SUPw)
'连接数据库
con.Open
getErr = True
On Error GoTo errID
'设置数据集对象rst,以返回CConsumers表中的所有活期账户账号
rst.Open "select * from CConsumers where id='" & txt(0).Text & _
"'", con, adOpenDynamic, adLockOptimistic
rst.Close
getErr = False
errID:
'判断CConsumers表是否存在输入的账户账号
If getErr = True Then
'CConsumers表不存在输入的账户账号,给出错误提示
MsgBox "您所输入的帐户号不存在!"
Exit Sub
End If
'调用frmQuery窗体的QueryID过程查找并显示该帐户的存款余额
Call frmQuery.QueryID(txt(0).Text)
'定义临时变量have,用于表示某些判断的结果
Dim have As Boolean
have = False
On Error GoTo errHave
'重新设置rst数据集对象,以返回与该储户账号对应