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

📄 数据库初始化.frm

📁 学生管理系统
💻 FRM
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form 数据库初始化 
   Caption         =   "数据库初始化"
   ClientHeight    =   3195
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   3195
   ScaleWidth      =   4680
   StartUpPosition =   3  '窗口缺省
   Begin VB.ListBox List1 
      Height          =   1320
      Left            =   240
      Style           =   1  'Checkbox
      TabIndex        =   4
      Top             =   0
      Width           =   4095
   End
   Begin VB.CommandButton Command3 
      Caption         =   "初始化"
      Height          =   375
      Left            =   3000
      TabIndex        =   3
      Top             =   2400
      Width           =   1215
   End
   Begin VB.CommandButton Command2 
      Caption         =   "全不选"
      Height          =   375
      Left            =   1680
      TabIndex        =   2
      Top             =   2400
      Width           =   975
   End
   Begin VB.CommandButton Command1 
      Caption         =   "全选"
      Height          =   375
      Left            =   360
      TabIndex        =   1
      Top             =   2400
      Width           =   975
   End
   Begin MSComctlLib.ProgressBar ProgressBar1 
      Height          =   495
      Left            =   240
      TabIndex        =   0
      Top             =   1800
      Width           =   4095
      _ExtentX        =   7223
      _ExtentY        =   873
      _Version        =   393216
      Appearance      =   1
   End
End
Attribute VB_Name = "数据库初始化"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim i As Integer
Private Sub Form_Load()
  Me.Caption = Text
  Dim rstSchema As ADODB.Recordset
  Set rstSchema = cnn.OpenSchema(adSchemaTables)
  Do Until rstSchema.EOF
     If Left(rstSchema!TABLE_NAME, 3) <> "sys" And Left(rstSchema!TABLE_NAME, 3) <> "dtp" Then
        List1.AddItem rstSchema!TABLE_NAME
     End If
     rstSchema.MoveNext
  Loop
  rstSchema.Close
End Sub
Private Sub Command1_Click()     '全选
  For i = 0 To List1.ListCount - 1
    List1.Selected(i) = True
  Next i
End Sub
Private Sub command2_Click()     '全不选
  For i = 0 To List1.ListCount - 1
     List1.Selected(i) = False
  Next i
End Sub
Private Sub command3_Click()    '清除所选表中数据
 Dim Counter As Integer     '定义一个整型变量
 Dim workarea(250) As String     '定义字符串变量
 ProgressBar1.Visible = True
 ProgressBar1.Max = UBound(workarea)
 ProgressBar1.Min = LBound(workarea)
 '设置进度的值为 Min
 ProgressBar1.Value = ProgressBar1.Min
 '在整个数组中循环
 For Counter = LBound(workarea) To UBound(workarea)
    '设置数组中每项的初始值
    workarea(Counter) = Counter
    ProgressBar1.Value = Counter
    For i = 0 To List1.ListCount - 1
      If List1.Selected(i) = True Then
        cnn.Execute ("delete from " & List1.list(i))
      End If
    Next i
 Next Counter
 ProgressBar1.Visible = False
 ProgressBar1.Value = ProgressBar1.Min
End Sub

⌨️ 快捷键说明

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