home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Internet Business Development Kit / PRODUCT_CD.iso / sqlsvr / i386 / cdinfo.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-07-12  |  3.4 KB  |  116 lines

  1. VERSION 4.00
  2. Begin VB.Form DInfo 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   3  'Fixed Dialog
  5.    Caption         =   "Dump Device Contents"
  6.    ClientHeight    =   3120
  7.    ClientLeft      =   1755
  8.    ClientTop       =   3930
  9.    ClientWidth     =   6165
  10.    Height          =   3525
  11.    Left            =   1695
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   3120
  16.    ScaleWidth      =   6165
  17.    Top             =   3585
  18.    Width           =   6285
  19.    Begin Threed.SSCommand Command1 
  20.       Height          =   345
  21.       Left            =   2160
  22.       TabIndex        =   2
  23.       Top             =   2610
  24.       Width           =   1575
  25.       _version        =   65536
  26.       _extentx        =   2778
  27.       _extenty        =   609
  28.       _stockprops     =   78
  29.       caption         =   "&Close"
  30.       bevelwidth      =   1
  31.       outline         =   0   'False
  32.    End
  33.    Begin VB.Label Label1 
  34.       BackColor       =   &H00C0C0C0&
  35.       Caption         =   "Dump Devices:"
  36.       Height          =   285
  37.       Left            =   210
  38.       TabIndex        =   1
  39.       Top             =   60
  40.       Width           =   5265
  41.    End
  42.    Begin MSGrid.Grid DGrid 
  43.       Height          =   2085
  44.       Left            =   150
  45.       TabIndex        =   0
  46.       Top             =   420
  47.       Width           =   5805
  48.       _version        =   65536
  49.       _extentx        =   10239
  50.       _extenty        =   3678
  51.       _stockprops     =   77
  52.       backcolor       =   16777215
  53.       cols            =   5
  54.       scrollbars      =   2
  55.       highlight       =   0   'False
  56.       mouseicon       =   "CDInfo.frx":0000
  57.    End
  58. Attribute VB_Name = "DInfo"
  59. Attribute VB_Creatable = False
  60. Attribute VB_Exposed = False
  61. Option Explicit
  62. Private Sub Command1_Click()
  63. Unload DInfo
  64. End Sub
  65. Private Sub Form_Load()
  66. ' display the contents of a DUMP device in a grid
  67. Dim I As Integer
  68. Dim S As String
  69. ' set up the grid values and column headings
  70. DGrid.Cols = 5
  71. DGrid.Row = 0
  72. DGrid.Col = 0
  73. DGrid.Text = "Type"
  74. DGrid.ColWidth(0) = 500
  75. DGrid.Col = 1
  76. DGrid.Text = "Database"
  77. DGrid.ColWidth(1) = 2000
  78. DGrid.Col = 2
  79. DGrid.Text = "Date"
  80. DGrid.ColWidth(2) = 1200
  81. DGrid.Col = 3
  82. DGrid.Text = "Time"
  83. DGrid.ColWidth(3) = 800
  84. DGrid.Col = 4
  85. DGrid.Text = "Size"
  86. DGrid.ColWidth(4) = 3000
  87. Label1.Caption = Label1.Caption + " " + CurrentDevice
  88. Dim MyResult As Object
  89. DGrid.Row = 1
  90. ' get the contents of device 'CurrentDevice' via .ReadBackupHeader
  91. Set MyResult = OServer.Devices(CurrentDevice).ReadBackupHeader
  92.     For I = 1 To MyResult.Rows  ' loop through result sets
  93.         DGrid.Col = 0
  94.         If MyResult.GetColumnString(I, 1) = "2" Then    ' log or DB dump?
  95.             DGrid.Text = "Log"
  96.         Else
  97.             DGrid.Text = "DB"
  98.         End If
  99.         DGrid.Col = 1
  100.         DGrid.Text = MyResult.GetColumnString(I, 2) ' database name
  101.         
  102.         DGrid.Col = 2
  103.         DGrid.Text = MyResult.GetColumnString(I, 14)    ' dated
  104.         DGrid.Col = 3
  105.         DGrid.Text = MyResult.GetColumnString(I, 15)    ' time
  106.         DGrid.Col = 4
  107.         DGrid.Text = MyResult.GetColumnString(I, 9)     ' size
  108.                     
  109.         If I <> MyResult.Rows Then
  110.             DGrid.Rows = DGrid.Rows + 1
  111.             DGrid.Row = DGrid.Row + 1
  112.         End If
  113.     Next I
  114. ' all done
  115. End Sub
  116.