frmDataViewer.frm
资源名称:考勤6.rar [点击查看]
上传用户:djzm888
上传日期:2013-02-15
资源大小:867k
文件大小:4k
源码类别:
其他数据库
开发平台:
Visual Basic
- VERSION 5.00
- Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
- Begin VB.Form frmDataViewer
- Caption = "Form1"
- ClientHeight = 6555
- ClientLeft = 60
- ClientTop = 345
- ClientWidth = 10095
- LinkTopic = "Form1"
- ScaleHeight = 6555
- ScaleWidth = 10095
- StartUpPosition = 3 '窗口缺省
- WindowState = 2 'Maximized
- Begin VB.CommandButton Command1
- Height = 585
- Left = 1920
- Picture = "frmDataViewer.frx":0000
- Style = 1 'Graphical
- TabIndex = 1
- Top = 705
- Width = 2025
- End
- Begin VB.Data datData
- Caption = "Data1"
- Connect = "Access"
- DatabaseName = "C:Program FilesMicrosoft Visual StudioVB98Biblio.mdb"
- DefaultCursorType= 0 '缺省游标
- DefaultType = 2 '使用 ODBC
- Exclusive = 0 'False
- Height = 345
- Left = 1575
- Options = 0
- ReadOnly = 0 'False
- RecordsetType = 1 'Dynaset
- RecordSource = "Publishers"
- Top = 5280
- Width = 2115
- End
- Begin MSComctlLib.StatusBar sbrData
- Align = 2 'Align Bottom
- Height = 345
- Left = 0
- TabIndex = 0
- Top = 6210
- Width = 10095
- _ExtentX = 17806
- _ExtentY = 609
- _Version = 393216
- BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628}
- NumPanels = 2
- BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628}
- Picture = "frmDataViewer.frx":0CE8
- EndProperty
- BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628}
- EndProperty
- EndProperty
- End
- End
- Attribute VB_Name = "frmDataViewer"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- Private Sub Form_Load()
- Dim pnlX As Panel
- Dim i As Integer
- For i = 1 To 3 '第一个面板已存在。
- Set pnlX = sbrData.Panels.Add()
- Next i
- For i = 1 To 4 ' < -- 新代码
- sbrData.Panels(i).AutoSize = sbrSpring '新
- Next i
- Dim myDB As Database, myRs As Recordset
- '将 Database 设置为 BIBLIO.MDB 数据库。
- Set myDB = DBEngine.Workspaces(0). _
- OpenDatabase("C:Program FilesMicrosoft Visual StudioVB98BIBLIO.MDB")
- '将记录集变量设置为 Authors 表。
- Set myRs = _
- myDB.OpenRecordset("Publishers", dbOpenTable)
- '将 Text 属性设置为记录集属性。
- sbrData.Panels(1).Text = "名称:" & myRs.Name
- sbrData.Panels(2).Text = "创建日期:" & _
- myRs.DateCreated
- sbrData.Panels(3).Text = "上一次修改的日期:" & _
- myRs.LastUpdated
- sbrData.Panels(4).Text = "编辑上锁:" & myRs.LockEdits
- End Sub
- Private Sub sbrData_PanelClick(ByVal Panel As Panel)
- Dim myRs As Recordset '声明 Recordset 变量。
- 'Data 控件的名称为 "datData"
- Set myRs = datData.Recordset '设置变量。
- Select Case Panel.Index
- Case 1 To 3
- '不能设置这些面板。
- Case 4 ' Updateable Property is settable.
- '切换该属性。
- myRs.LockEdits = Abs(myRs.LockEdits) - 1
- '更新 Panel 对象的 Text 属性。
- sbrData.Panels(4).Text = "LockEdits: " _
- & myRs.LockEdits
- End Select
- End Sub