home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 4 Unleashed / Visual_Basic_4_Unleashed_SAMS_Publishing_1995.iso / crystal / extras / crpedemo / table.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1994-12-15  |  6.1 KB  |  208 lines

  1. VERSION 2.00
  2. Begin Form Tablem 
  3.    BackColor       =   &H00C0C0C0&
  4.    Caption         =   "Table Management"
  5.    ClientHeight    =   3615
  6.    ClientLeft      =   2025
  7.    ClientTop       =   1995
  8.    ClientWidth     =   7260
  9.    Height          =   4020
  10.    Left            =   1965
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   3615
  13.    ScaleWidth      =   7260
  14.    Top             =   1650
  15.    Width           =   7380
  16.    Begin CommandButton Command1 
  17.       Caption         =   "Ok"
  18.       Height          =   345
  19.       Left            =   960
  20.       TabIndex        =   6
  21.       Top             =   3030
  22.       Width           =   1665
  23.    End
  24.    Begin SSFrame Frame3D1 
  25.       Caption         =   "Table Information"
  26.       Font3D          =   0  'None
  27.       Height          =   2565
  28.       Left            =   270
  29.       TabIndex        =   9
  30.       Top             =   210
  31.       Width           =   6765
  32.       Begin CommandButton Command9 
  33.          Caption         =   "Set Location"
  34.          Height          =   345
  35.          Left            =   150
  36.          TabIndex        =   2
  37.          Top             =   930
  38.          Width           =   1395
  39.       End
  40.       Begin ComboBox LocationCombo 
  41.          Height          =   300
  42.          Left            =   150
  43.          Style           =   2  'Dropdown List
  44.          TabIndex        =   0
  45.          Top             =   390
  46.          Width           =   3315
  47.       End
  48.       Begin TextBox Text10 
  49.          Height          =   345
  50.          Left            =   1770
  51.          TabIndex        =   1
  52.          Top             =   945
  53.          Width           =   3885
  54.       End
  55.       Begin TextBox Text9 
  56.          Height          =   285
  57.          Left            =   1770
  58.          TabIndex        =   5
  59.          Top             =   2100
  60.          Width           =   2775
  61.       End
  62.       Begin TextBox Text8 
  63.          Height          =   285
  64.          Left            =   1770
  65.          TabIndex        =   4
  66.          Top             =   1740
  67.          Width           =   2775
  68.       End
  69.       Begin TextBox Text7 
  70.          Height          =   285
  71.          Left            =   1770
  72.          TabIndex        =   3
  73.          Top             =   1380
  74.          Width           =   2775
  75.       End
  76.       Begin Label Label7 
  77.          BackColor       =   &H00C0C0C0&
  78.          Caption         =   "Database Type"
  79.          Height          =   240
  80.          Left            =   180
  81.          TabIndex        =   12
  82.          Top             =   2130
  83.          Width           =   1455
  84.       End
  85.       Begin Label Label6 
  86.          BackColor       =   &H00C0C0C0&
  87.          Caption         =   "Descriptive Name"
  88.          Height          =   255
  89.          Left            =   180
  90.          TabIndex        =   11
  91.          Top             =   1740
  92.          Width           =   1545
  93.       End
  94.       Begin Label Label5 
  95.          BackColor       =   &H00C0C0C0&
  96.          Caption         =   "DLL Name"
  97.          Height          =   240
  98.          Left            =   180
  99.          TabIndex        =   10
  100.          Top             =   1410
  101.          Width           =   1275
  102.       End
  103.    End
  104.    Begin CommandButton Command7 
  105.       Caption         =   "Help"
  106.       Height          =   345
  107.       Left            =   4740
  108.       TabIndex        =   8
  109.       Top             =   3030
  110.       Width           =   1725
  111.    End
  112.    Begin CommandButton Command6 
  113.       Caption         =   "Close"
  114.       Height          =   345
  115.       Left            =   2820
  116.       TabIndex        =   7
  117.       Top             =   3030
  118.       Width           =   1725
  119.    End
  120. Dim LocInfo As PETableLocation
  121. Sub Command1_Click ()
  122.  Unload Me
  123. End Sub
  124. Sub Command2_Click ()
  125. End Sub
  126. Sub Command3_Click ()
  127. End Sub
  128. Sub Command4_Click ()
  129. End Sub
  130. Sub Command5_Click ()
  131. End Sub
  132. Sub Command6_Click ()
  133.  Unload Me
  134. End Sub
  135. Sub Command7_Click ()
  136.  RCode = Shell("Winhelp c:\crw\crw.hlp", 3)
  137. End Sub
  138. Sub Command8_Click ()
  139. End Sub
  140. Sub Command9_Click ()
  141. 'Declarations
  142.     Dim LocInfo As PETableLocation
  143. 'Define Structure
  144.     LocInfo.StructSize = Len(LocInfo)
  145.     LocInfo.Location = Text10.Text + Chr$(0)
  146. 'Set table location
  147.     If PESetNthTableLocation(Jobnum, TableN, LocInfo) = 1 Then
  148.         Main!StatusBar.Caption = "Table Location Set"
  149.     Else
  150.       RCode = GetErrorString(Jobnum)
  151.       MsgBox "PESetNthTableLocation Error #: " + Str(ErrorCode) + " - " + RCode
  152.       Exit Sub
  153.     End If
  154. End Sub
  155. Sub Form_Load ()
  156. 'Declarations
  157. Dim I As Integer
  158. 'Check to see if there is a job open
  159.    If Jobnum = 0 Then
  160.        MsgBox "No job open."
  161.        Exit Sub
  162.    End If
  163. ' The function PEGetNTables is called to fetch the number of tables in
  164. ' the report.  This includes all PC databases (e.g. Paradox, xBase)
  165. ' as well as SQL databases (e.g. SQL Server, Oracle, Netware).
  166. NTables = PEGetNTables(Jobnum)
  167. For I = 0 To NTables - 1
  168.     LocInfo.Location = Chr$(0)
  169.     LocInfo.StructSize = Len(LocInfo)
  170.     If PEGetNthTableLocation(Jobnum, I, LocInfo) = 1 Then
  171.         LocationCombo.AddItem LocInfo.Location
  172.     Else
  173.       RCode = GetErrorString(Jobnum)
  174.       MsgBox "PEGetNthTableLocation Error #: " + Str(ErrorCode) + " - " + RCode
  175.       Exit Sub
  176.     End If
  177. Next I
  178. End Sub
  179. Sub LocationCombo_Click ()
  180. 'Declarations
  181.   Dim TableType As PETableType
  182. 'Define Structure
  183.   TableType.StructSize = Len(TableType)
  184.   TableType.DLLName = Chr$(0)
  185.   TableType.DescriptiveName = Chr$(0)
  186.   'TableType.DBType
  187. 'Get the table type based on the specific table names
  188.   If PEGetNthTableType(Jobnum, LocationCombo.ListIndex, TableType) = False Then
  189.       RCode = GetErrorString(Jobnum)
  190.       MsgBox "PEGetNthTableType Error #: " + Str(ErrorCode) + " - " + RCode
  191.   Else
  192.      
  193.      Text7.Text = TableType.DLLName
  194.      Text8.Text = TableType.DescriptiveName
  195.      Text10.Text = LocInfo.Location
  196. 'Database types are returned as either 0 or 1. Return a more
  197. 'descriptive message to the message box
  198.      If TableType.DBType = 1 Then
  199.        Text9.Text = "PC Table/Database"
  200.      Else
  201.        Text9.Text = "SQL Table"
  202.      End If
  203.   End If
  204. End Sub
  205. Sub MenuExit_Click ()
  206.  Unload Me
  207. End Sub
  208.