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

📄 main.frm

📁 一个简单的数据库操作例子,特别适合初学者.vb数据库编程练习
💻 FRM
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "Mscomctl.ocx"
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form 系统单机版 
   BackColor       =   &H8000000C&
   Caption         =   "[系统单机版]"
   ClientHeight    =   4080
   ClientLeft      =   165
   ClientTop       =   855
   ClientWidth     =   6645
   Icon            =   "main.frx":0000
   LinkTopic       =   "Form1"
   ScaleHeight     =   4080
   ScaleWidth      =   6645
   StartUpPosition =   3  '窗口缺省
   WindowState     =   2  'Maximized
   Begin MSComctlLib.ImageList ImageList1 
      Left            =   5400
      Top             =   2040
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483643
      ImageWidth      =   32
      ImageHeight     =   32
      MaskColor       =   12632256
      _Version        =   393216
      BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
         NumListImages   =   5
         BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "main.frx":0CCA
            Key             =   ""
         EndProperty
         BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "main.frx":15A4
            Key             =   ""
         EndProperty
         BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "main.frx":1E7E
            Key             =   ""
         EndProperty
         BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "main.frx":3100
            Key             =   ""
         EndProperty
         BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "main.frx":39DA
            Key             =   ""
         EndProperty
      EndProperty
   End
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   330
      Left            =   3000
      Top             =   2760
      Visible         =   0   'False
      Width           =   1335
      _ExtentX        =   2355
      _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 MSComctlLib.StatusBar StatusBar1 
      Align           =   2  'Align Bottom
      Height          =   375
      Left            =   0
      TabIndex        =   1
      Top             =   3705
      Width           =   6645
      _ExtentX        =   11721
      _ExtentY        =   661
      _Version        =   393216
      BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628} 
         NumPanels       =   3
         BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Object.Width           =   7056
            MinWidth        =   7056
         EndProperty
         BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Object.Width           =   14111
            MinWidth        =   14111
         EndProperty
         BeginProperty Panel3 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Object.Width           =   6174
            MinWidth        =   6174
         EndProperty
      EndProperty
   End
   Begin MSComctlLib.Toolbar Toolbar1 
      Align           =   1  'Align Top
      Height          =   795
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   6645
      _ExtentX        =   11721
      _ExtentY        =   1402
      ButtonWidth     =   1455
      ButtonHeight    =   1349
      Appearance      =   1
      Style           =   1
      ImageList       =   "ImageList1"
      _Version        =   393216
      BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
         NumButtons      =   5
         BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "库存商品"
            Key             =   "kcsp"
            Object.ToolTipText     =   "库存商品"
            ImageIndex      =   1
         EndProperty
         BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "来往单位"
            Key             =   "lwdw"
            Object.ToolTipText     =   "来往单位"
            ImageIndex      =   2
         EndProperty
         BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "现金帐"
            Key             =   "xjz"
            Object.ToolTipText     =   "现金帐"
            ImageIndex      =   3
         EndProperty
         BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "费用"
            Key             =   "fy"
            Object.ToolTipText     =   "费用"
            ImageIndex      =   4
         EndProperty
         BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "仓库"
            Key             =   "ck"
            Object.ToolTipText     =   "仓库"
            ImageIndex      =   5
         EndProperty
      EndProperty
   End
   Begin VB.Menu system 
      Caption         =   "系统(&S)"
      Begin VB.Menu add 
         Caption         =   "添加用户  "
      End
      Begin VB.Menu change 
         Caption         =   "用户修改  "
      End
      Begin VB.Menu line 
         Caption         =   "-"
      End
      Begin VB.Menu quit 
         Caption         =   "退出"
      End
   End
   Begin VB.Menu basic 
      Caption         =   "基本信息(&B)"
      Begin VB.Menu storage 
         Caption         =   "库存商品  "
      End
      Begin VB.Menu unit 
         Caption         =   "往来单位"
      End
      Begin VB.Menu cash 
         Caption         =   "现金帐"
      End
      Begin VB.Menu charge 
         Caption         =   "费用"
      End
      Begin VB.Menu storeroom 
         Caption         =   "仓库"
      End
   End
   Begin VB.Menu dataenter 
      Caption         =   "数据录入(&D)"
   End
   Begin VB.Menu about 
      Caption         =   "关于(&H)"
      Begin VB.Menu aboutus 
         Caption         =   "关于我们"
      End
   End
End
Attribute VB_Name = "系统单机版"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub aboutus_Click()
关于我们.Show 1
End Sub

Private Sub add_Click()
添加用户.Show 1
End Sub

Private Sub cash_Click()
Adodc1.RecordSource = "select*from 现金帐"
Adodc1.Refresh
If Adodc1.Recordset.EOF Then
MsgBox "对不起,现金帐为空,请添加!", 48, "信息提示"
添加现金帐.Show 1
Else
现金帐.Show 1
End If
End Sub

Private Sub charge_Click()
Adodc1.RecordSource = "select * from 费用"
Adodc1.Refresh
If Adodc1.Recordset.EOF Then
MsgBox "对不起,费用项目为空,请添加!", 48, "信息提示"
添加费用.Show 1
Else
费用.Show 1
End If
End Sub

Private Sub Form_Load()

StatusBar1.Panels(1).Text = "设计者: Dangdangde"
StatusBar1.Panels(2).Text = "当前操作员: " & user & "级别: " & aa
StatusBar1.Panels(3).Text = "当前时间:  " & Now

'Dim aa As String
'Select Case Executeqx(1)
'Case "admin"
'  aa = "超级管理员"
'Case "readonly"
'  aa = "只读管理员"
'Case Else
'  aa = "普通管理员"
'End Select
'StatusBar1.Panels(4).Text = "状态:   " & aa
End Sub

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
 ' If MsgBox("真的要对出本系统吗?", vbQuestion + vbYesNo + vbDefaultButton2, "退出") = vbNo Then
  '  Cancel = 1
 ' End If
End Sub

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

End Sub

Private Sub storage_Click()

Adodc1.RecordSource = "select*from 库存商品"
Adodc1.Refresh
If Adodc1.Recordset.EOF Then
MsgBox "对不起,库存量为空,请添加!", 48, "信息提示"
添加库存.Show 1
Else
库存商品.Show 1
End If

End Sub

Private Sub storeroom_Click()
Adodc1.RecordSource = "select * from 仓库"
Adodc1.Refresh
If Adodc1.Recordset.EOF Then
MsgBox "对不起,仓库为空,请添加!", 48, "信息提示"
添加仓库.Show 1
Else
仓库.Show 1
End If
End Sub

Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Select Case Button.Key
Case "kcsp"
Adodc1.RecordSource = "select*from 库存商品"
Adodc1.Refresh
If Adodc1.Recordset.EOF Then
MsgBox "库存量为空,请添加!", 48, "添加"
添加库存.Show 1
Else
库存商品.Show 1
End If
Case "lwdw"
Adodc1.RecordSource = "select*from 来往单位"
Adodc1.Refresh
If Adodc1.Recordset.EOF Then
MsgBox "单位为空,请添加!", 48, "添加"
添加单位.Show 1
Else
来往单位.Show 1
End If
Case "xjz"
Adodc1.RecordSource = "select * from 现金帐"
Adodc1.Refresh
If Adodc1.Recordset.EOF Then
MsgBox "现金帐为空,请添加!", 48, "添加"
添加现金帐.Show 1
Else
现金帐.Show 1
End If
Case "fy"
Adodc1.RecordSource = "select * from 费用"
Adodc1.Refresh
If Adodc1.Recordset.EOF Then
MsgBox "费用为空,请添加!", 48, "添加"
添加费用.Show 1
Else
费用.Show 1
End If
Case "ck"
Adodc1.RecordSource = "select * from 仓库"
Adodc1.Refresh
If Adodc1.Recordset.EOF Then
MsgBox "费用为空,请添加!", 48, "添加"
添加仓库.Show 1
Else
仓库.Show 1
End If
End Select
End Sub

Private Sub unit_Click()
Adodc1.RecordSource = "select * from 来往单位"
Adodc1.Refresh
If Adodc1.Recordset.EOF Then
MsgBox "对不起,单位为空,请添加!", 48, "信息提示"
添加单位.Show 1
Else
来往单位.Show 1
End If
End Sub

⌨️ 快捷键说明

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