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

📄 form1.frm

📁 vb 的例子
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Data控件示例"
   ClientHeight    =   3585
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4320
   LinkTopic       =   "Form1"
   ScaleHeight     =   3585
   ScaleWidth      =   4320
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton cmdDelete 
      Caption         =   "删除记录"
      Height          =   375
      Left            =   3240
      TabIndex        =   13
      Top             =   3000
      Width           =   855
   End
   Begin VB.CommandButton cmdAdd 
      Caption         =   "添加记录"
      Height          =   375
      Left            =   2160
      TabIndex        =   12
      Top             =   3000
      Width           =   975
   End
   Begin VB.TextBox Text6 
      DataField       =   "电话"
      DataSource      =   "DatEmployee"
      Height          =   360
      Left            =   1200
      TabIndex        =   11
      Text            =   "Text4"
      Top             =   2160
      Width           =   2760
   End
   Begin VB.TextBox Text2 
      DataField       =   "姓名"
      DataSource      =   "DatEmployee"
      Height          =   390
      Left            =   2520
      TabIndex        =   9
      Text            =   "Text1"
      Top             =   120
      Width           =   1455
   End
   Begin VB.TextBox Text5 
      DataField       =   "邮政编码"
      DataSource      =   "DatEmployee"
      Height          =   360
      Left            =   1200
      TabIndex        =   8
      Text            =   "Text4"
      Top             =   1680
      Width           =   2760
   End
   Begin VB.Data DatEmployee 
      Caption         =   "雇员"
      Connect         =   "FoxPro 3.0;"
      DatabaseName    =   "E:\"
      DefaultCursorType=   0  'DefaultCursor
      DefaultType     =   2  'UseODBC
      Exclusive       =   0   'False
      Height          =   390
      Left            =   240
      Options         =   0
      ReadOnly        =   0   'False
      RecordsetType   =   0  'Table
      RecordSource    =   "gy"
      Top             =   3000
      Width           =   1875
   End
   Begin VB.TextBox Text1 
      DataField       =   "代号"
      DataSource      =   "DatEmployee"
      Height          =   390
      Left            =   720
      TabIndex        =   2
      Text            =   "Text1"
      Top             =   120
      Width           =   855
   End
   Begin VB.TextBox Text3 
      DataField       =   "出生日期"
      DataSource      =   "DatEmployee"
      Height          =   360
      Left            =   1200
      TabIndex        =   1
      Text            =   "Text3"
      Top             =   720
      Width           =   2775
   End
   Begin VB.TextBox Text4 
      DataField       =   "地址"
      DataSource      =   "DatEmployee"
      Height          =   360
      Left            =   750
      TabIndex        =   0
      Text            =   "Text4"
      Top             =   1215
      Width           =   3225
   End
   Begin VB.Label Label6 
      Caption         =   "电话号码"
      Height          =   195
      Left            =   240
      TabIndex        =   10
      Top             =   2280
      Width           =   765
   End
   Begin VB.Label Label5 
      Caption         =   "邮政编码"
      Height          =   195
      Left            =   240
      TabIndex        =   7
      Top             =   1800
      Width           =   765
   End
   Begin VB.Label Label1 
      Caption         =   "姓名"
      Height          =   300
      Left            =   1920
      TabIndex        =   6
      Top             =   240
      Width           =   390
   End
   Begin VB.Label Label2 
      Caption         =   "编号"
      Height          =   255
      Left            =   240
      TabIndex        =   5
      Top             =   240
      Width           =   690
   End
   Begin VB.Label Label3 
      Caption         =   "出生年月"
      Height          =   240
      Left            =   240
      TabIndex        =   4
      Top             =   750
      Width           =   795
   End
   Begin VB.Label Label4 
      Caption         =   "地址址"
      Height          =   195
      Left            =   240
      TabIndex        =   3
      Top             =   1275
      Width           =   525
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub cmdAdd_Click()
    DatEmployee.Recordset.AddNew
    DatEmployee.Recordset.Update
    DatEmployee.Recordset.movelast
End Sub

Private Sub cmdDelete_Click()
    DatEmployee.Recordset.Delete
    DatEmployee.Recordset.movefirst
End Sub

⌨️ 快捷键说明

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