home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / crwdemo / table.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-12-05  |  7.4 KB  |  260 lines

  1. VERSION 2.00
  2. Begin Form Tablem 
  3.    BackColor       =   &H00C0C0C0&
  4.    Caption         =   "Table Management"
  5.    ClientHeight    =   6015
  6.    ClientLeft      =   2460
  7.    ClientTop       =   1965
  8.    ClientWidth     =   4485
  9.    Height          =   6705
  10.    Left            =   2400
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   6015
  13.    ScaleWidth      =   4485
  14.    Top             =   1335
  15.    Width           =   4605
  16.    Begin TextBox Text6 
  17.       Height          =   285
  18.       Left            =   1890
  19.       TabIndex        =   15
  20.       Top             =   3375
  21.       Width           =   2445
  22.    End
  23.    Begin TextBox Text5 
  24.       Height          =   285
  25.       Left            =   1890
  26.       TabIndex        =   14
  27.       Top             =   3015
  28.       Width           =   2445
  29.    End
  30.    Begin TextBox Text4 
  31.       Height          =   420
  32.       Left            =   2790
  33.       TabIndex        =   7
  34.       Top             =   495
  35.       Width           =   1365
  36.    End
  37.    Begin CommandButton Command8 
  38.       Caption         =   "Number of Tables"
  39.       Height          =   420
  40.       Left            =   630
  41.       TabIndex        =   13
  42.       Top             =   495
  43.       Width           =   1995
  44.    End
  45.    Begin SSPanel StatusBar 
  46.       Alignment       =   1  'Left Justify - MIDDLE
  47.       BorderWidth     =   1
  48.       Height          =   555
  49.       Left            =   0
  50.       TabIndex        =   12
  51.       Top             =   5445
  52.       Width           =   4515
  53.    End
  54.    Begin CommandButton Command7 
  55.       Caption         =   "Help"
  56.       Height          =   420
  57.       Left            =   2340
  58.       TabIndex        =   11
  59.       Top             =   4860
  60.       Width           =   1725
  61.    End
  62.    Begin CommandButton Command6 
  63.       Caption         =   "Close"
  64.       Height          =   420
  65.       Left            =   450
  66.       TabIndex        =   10
  67.       Top             =   4860
  68.       Width           =   1725
  69.    End
  70.    Begin CommandButton Command5 
  71.       Caption         =   "Set Table Location"
  72.       Height          =   420
  73.       Left            =   2430
  74.       TabIndex        =   9
  75.       Top             =   4320
  76.       Width           =   1725
  77.    End
  78.    Begin CommandButton Command4 
  79.       Caption         =   "Get Table Location"
  80.       Height          =   420
  81.       Left            =   360
  82.       TabIndex        =   8
  83.       Top             =   4320
  84.       Width           =   1725
  85.    End
  86.    Begin CommandButton Command3 
  87.       Caption         =   "Table Type"
  88.       Height          =   420
  89.       Left            =   1710
  90.       TabIndex        =   6
  91.       Top             =   2070
  92.       Width           =   1275
  93.    End
  94.    Begin CommandButton Command2 
  95.       Caption         =   ">>"
  96.       Height          =   420
  97.       Left            =   3150
  98.       TabIndex        =   4
  99.       Top             =   1530
  100.       Width           =   915
  101.    End
  102.    Begin CommandButton Command1 
  103.       Caption         =   "<<"
  104.       Height          =   420
  105.       Left            =   630
  106.       TabIndex        =   3
  107.       Top             =   1530
  108.       Width           =   915
  109.    End
  110.    Begin TextBox Text3 
  111.       Height          =   465
  112.       Left            =   180
  113.       TabIndex        =   2
  114.       Top             =   3780
  115.       Width           =   4155
  116.    End
  117.    Begin TextBox Text2 
  118.       Height          =   285
  119.       Left            =   1890
  120.       TabIndex        =   1
  121.       Top             =   2655
  122.       Width           =   2445
  123.    End
  124.    Begin TextBox Text1 
  125.       Height          =   420
  126.       Left            =   1710
  127.       TabIndex        =   0
  128.       Top             =   1530
  129.       Width           =   1275
  130.    End
  131.    Begin Label Label4 
  132.       BackColor       =   &H00C0C0C0&
  133.       Caption         =   "Database Type"
  134.       Height          =   240
  135.       Left            =   180
  136.       TabIndex        =   17
  137.       Top             =   3420
  138.       Width           =   1455
  139.    End
  140.    Begin Label Label3 
  141.       BackColor       =   &H00C0C0C0&
  142.       Caption         =   "Descriptive Name"
  143.       Height          =   285
  144.       Left            =   180
  145.       TabIndex        =   18
  146.       Top             =   3015
  147.       Width           =   1545
  148.    End
  149.    Begin Label Label2 
  150.       BackColor       =   &H00C0C0C0&
  151.       Caption         =   "DLL Name"
  152.       Height          =   240
  153.       Left            =   180
  154.       TabIndex        =   16
  155.       Top             =   2655
  156.       Width           =   1275
  157.    End
  158.    Begin Label Label1 
  159.       Alignment       =   2  'Center
  160.       BackColor       =   &H00C0C0C0&
  161.       Caption         =   "Increment Table Number"
  162.       Height          =   240
  163.       Left            =   630
  164.       TabIndex        =   5
  165.       Top             =   1125
  166.       Width           =   3435
  167.    End
  168.    Begin Menu MenuFile 
  169.       Caption         =   "&File"
  170.       Begin Menu MenuExit 
  171.          Caption         =   "&Exit"
  172.       End
  173.    End
  174. Sub Command1_Click ()
  175.    Dim nTables As Integer
  176.    If (TableN > 0) Then
  177.       TableN = TableN - 1
  178.       Text1.Text = TableN
  179.    End If
  180. End Sub
  181. Sub Command2_Click ()
  182.    Dim nTables As Integer
  183.    nTables = PEGetNTables(JobNum)
  184.    If nTables = 0 Then
  185.      Text1.Text = 0
  186.    Else
  187.      If (TableN < nTables - 1) Then
  188.         TableN = TableN + 1
  189.         Text1.Text = TableN
  190.      End If
  191.    End If
  192. End Sub
  193. Sub Command3_Click ()
  194.   Dim TableType As PETableType
  195.   TableType.StructSize = Len(TableType)
  196.   TableType.DLLName = Chr$(0)
  197.   TableType.DescriptiveName = Chr$(0)
  198.   'TableType.DBType
  199.   If PEGetNthTableType(JobNum, TableN, TableType) = False Then
  200.       RCode = GetErrorString(JobNum)
  201.       MsgBox "PEGetNthTableType Error #: " + Str(ErrorCode) + " - " + RCode
  202.   Else
  203.      Tablem!StatusBar.Caption = "Table Type " + Text1.Text + " has been retrieved"
  204.      Text2.Text = TableType.DLLName
  205.      Text5.Text = TableType.DescriptiveName
  206.      Text6.Text = TableType.DBType
  207.   End If
  208. End Sub
  209. Sub Command4_Click ()
  210. Dim locInfo As PETableLocation
  211.     locInfo.Location = Chr$(0)
  212.     locInfo.StructSize = Len(locInfo)
  213.     If PEGetNthTableLocation(JobNum, TableN, locInfo) = 1 Then
  214.         Text3.Text = locInfo.Location
  215.         Tablem!StatusBar.Caption = "Table Location Retrieved"
  216.     Else
  217.       RCode = GetErrorString(JobNum)
  218.       MsgBox "PEGetNthTableLocation Error #: " + Str(ErrorCode) + " - " + RCode
  219.        
  220.       Exit Sub
  221.     End If
  222. End Sub
  223. Sub Command5_Click ()
  224.     Dim locInfo As PETableLocation
  225.     locInfo.StructSize = Len(locInfo)
  226.     locInfo.Location = Text3.Text + Chr$(0)
  227.     If PESetNthTableLocation(JobNum, TableN, locInfo) = 1 Then
  228.         Tablem!StatusBar.Caption = "Table Location Set"
  229.     Else
  230.       RCode = GetErrorString(JobNum)
  231.       MsgBox "PESetNthTableLocation Error #: " + Str(ErrorCode) + " - " + RCode
  232.         
  233.       Exit Sub
  234.     End If
  235. End Sub
  236. Sub Command6_Click ()
  237.  Unload Me
  238. End Sub
  239. Sub Command7_Click ()
  240.  RCode = Shell("Winhelp c:\crw\crw.hlp", 3)
  241.  If RCode = False Then
  242.    MsgBox ("CRWDEMO cannot find the Crystal Help file in C:\CRW directory")
  243.  End If
  244. End Sub
  245. Sub Command8_Click ()
  246.    If JobNum = 0 Then
  247.        MsgBox "No job open."
  248.        Exit Sub
  249.    End If
  250.  nTables = PEGetNTables(JobNum)
  251.  Tablem!StatusBar.Caption = "Number of Tables Retrieved"
  252.  Text4.Text = nTables
  253.  If nTables > 0 Then
  254.    Text1.Text = 0
  255.  End If
  256. End Sub
  257. Sub MenuExit_Click ()
  258.  Unload Me
  259. End Sub
  260.