⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 addcash.frm

📁 一个简单的数据库操作例子,特别适合初学者.vb数据库编程练习
💻 FRM
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form 添加现金帐 
   Caption         =   "添加现金帐"
   ClientHeight    =   3285
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   5880
   LinkTopic       =   "Form1"
   ScaleHeight     =   3285
   ScaleWidth      =   5880
   StartUpPosition =   2  '屏幕中心
   Begin VB.Frame Frame1 
      Caption         =   "添加现金帐"
      Height          =   3015
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   5655
      Begin VB.TextBox Text2 
         Height          =   270
         Left            =   3840
         TabIndex        =   4
         Top             =   360
         Width           =   1695
      End
      Begin VB.TextBox Text4 
         Height          =   270
         Left            =   3840
         TabIndex        =   8
         Top             =   1080
         Width           =   1695
      End
      Begin VB.TextBox Text1 
         Height          =   270
         Left            =   1080
         TabIndex        =   2
         Top             =   360
         Width           =   1695
      End
      Begin VB.TextBox Text3 
         Height          =   270
         Left            =   1080
         TabIndex        =   6
         Top             =   1080
         Width           =   1695
      End
      Begin VB.TextBox Text5 
         Height          =   270
         Left            =   1080
         TabIndex        =   10
         Top             =   1800
         Width           =   1695
      End
      Begin VB.CommandButton Command1 
         Caption         =   "保存"
         Default         =   -1  'True
         Height          =   375
         Left            =   1800
         TabIndex        =   11
         Top             =   2400
         Width           =   855
      End
      Begin VB.CommandButton Command2 
         Caption         =   "取消"
         Height          =   375
         Left            =   3240
         TabIndex        =   12
         Top             =   2400
         Width           =   855
      End
      Begin MSAdodcLib.Adodc Adodc1 
         Height          =   330
         Left            =   360
         Top             =   2520
         Visible         =   0   'False
         Width           =   1200
         _ExtentX        =   2117
         _ExtentY        =   582
         ConnectMode     =   0
         CursorLocation  =   3
         IsolationLevel  =   -1
         ConnectionTimeout=   15
         CommandTimeout  =   30
         CursorType      =   3
         LockType        =   3
         CommandType     =   8
         CursorOptions   =   0
         CacheSize       =   50
         MaxRecords      =   0
         BOFAction       =   0
         EOFAction       =   0
         ConnectStringType=   1
         Appearance      =   1
         BackColor       =   -2147483643
         ForeColor       =   -2147483640
         Orientation     =   0
         Enabled         =   -1
         Connect         =   "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=order.mdb;Persist Security Info=False"
         OLEDBString     =   "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=order.mdb;Persist Security Info=False"
         OLEDBFile       =   ""
         DataSourceName  =   ""
         OtherAttributes =   ""
         UserName        =   ""
         Password        =   ""
         RecordSource    =   ""
         Caption         =   "Adodc1"
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         _Version        =   393216
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "银行编号"
         Height          =   180
         Left            =   240
         TabIndex        =   1
         Top             =   405
         Width           =   720
      End
      Begin VB.Label Label2 
         AutoSize        =   -1  'True
         Caption         =   "银行名称"
         Height          =   180
         Left            =   3000
         TabIndex        =   3
         Top             =   405
         Width           =   720
      End
      Begin VB.Label Label3 
         AutoSize        =   -1  'True
         Caption         =   "银行户名"
         Height          =   180
         Left            =   240
         TabIndex        =   5
         Top             =   1125
         Width           =   720
      End
      Begin VB.Label Label4 
         AutoSize        =   -1  'True
         Caption         =   "银行帐号"
         Height          =   180
         Left            =   3000
         TabIndex        =   7
         Top             =   1125
         Width           =   720
      End
      Begin VB.Label Label5 
         AutoSize        =   -1  'True
         Caption         =   "银行卡号"
         Height          =   180
         Left            =   240
         TabIndex        =   9
         Top             =   1845
         Width           =   720
      End
   End
End
Attribute VB_Name = "添加现金帐"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
If Text1 = "" Then
MsgBox "银行编号不能为空", 48, "提示信息"
ElseIf Text2 = "" Then
MsgBox "银行名称不能为空", 48, "提示信息"
ElseIf Text3 = "" Then
MsgBox "银行户名不能为空", 48, "提示信息"
ElseIf Text4 = "" Then
MsgBox "银行帐号不能为空", 48, "提示信息"
ElseIf Text5 = "" Then
MsgBox "银行卡号不能为空", 48, "提示信息"
Else
Adodc1.RecordSource = "select * from 现金帐"
Adodc1.Refresh
Adodc1.Recordset.AddNew
Adodc1.Recordset.Fields("银行编号") = Trim(Text1.Text)
Adodc1.Recordset.Fields("银行名称") = Trim(Text2.Text)
Adodc1.Recordset.Fields("银行户名") = Trim(Text3.Text)
Adodc1.Recordset.Fields("银行帐号") = Trim(Text4.Text)
Adodc1.Recordset.Fields("银行卡号") = Trim(Text5.Text)
Adodc1.Recordset.Update
Adodc1.Refresh
MsgBox "添加成功,请按确定返回", 64, "提示信息"
Unload Me
'现金帐.Show
End If
End Sub

Private Sub Command2_Click()
'Dim out As Integer
'out = MsgBox("真的要退出吗?", 32 + vbYesNo, "退出")
'If out = 6 Then
Unload Me
'End If
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -