home *** CD-ROM | disk | FTP | other *** search
/ On Hand / On_Hand_From_Softbank_1994_Release_2_Disc_2_1994.iso / 00202 / s / disk4 / tables.fr_ / tables.bin
Text File  |  1993-04-28  |  5KB  |  214 lines

  1. VERSION 2.00
  2. Begin Form fTables 
  3.    BackColor       =   &H00C0C0C0&
  4.    Caption         =   "<none>"
  5.    ClientHeight    =   3255
  6.    ClientLeft      =   510
  7.    ClientTop       =   1575
  8.    ClientWidth     =   3000
  9.    Height          =   3660
  10.    Icon            =   TABLES.FRX:0000
  11.    Left            =   450
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    MDIChild        =   -1  'True
  15.    ScaleHeight     =   3235.273
  16.    ScaleMode       =   0  'User
  17.    ScaleWidth      =   3020.896
  18.    Top             =   1230
  19.    Width           =   3120
  20.    Begin CommandButton NewTableButton 
  21.       Caption         =   "&New"
  22.       Height          =   375
  23.       Left            =   120
  24.       TabIndex        =   4
  25.       Top             =   120
  26.       Width           =   855
  27.    End
  28.    Begin CommandButton StructButton 
  29.       Caption         =   "&Design"
  30.       Height          =   375
  31.       Left            =   2040
  32.       TabIndex        =   2
  33.       Top             =   120
  34.       Width           =   855
  35.    End
  36.    Begin CommandButton OpenButton 
  37.       Caption         =   "&Open"
  38.       Height          =   375
  39.       Left            =   1080
  40.       TabIndex        =   1
  41.       Top             =   120
  42.       Width           =   855
  43.    End
  44.    Begin ListBox cTableList 
  45.       BackColor       =   &H00FFFFFF&
  46.       Height          =   2175
  47.       Left            =   120
  48.       Sorted          =   -1  'True
  49.       TabIndex        =   0
  50.       Tag             =   "OL"
  51.       Top             =   855
  52.       Width           =   2775
  53.    End
  54.    Begin Label TableListLabel 
  55.       BackColor       =   &H00C0C0C0&
  56.       Caption         =   "Tables:"
  57.       Height          =   255
  58.       Left            =   120
  59.       TabIndex        =   3
  60.       Top             =   584
  61.       Width           =   2775
  62.    End
  63. End
  64. Option Explicit
  65.  
  66. Sub cTableList_DblClick ()
  67.   gfFromSQL = False
  68.   Call OpenButton_Click
  69. End Sub
  70.  
  71. Sub Form_Load ()
  72.  
  73.   If gfDBOpenFlag = True Then
  74.     Caption = gstDBName + "." + gstDataBase
  75.   End If
  76.  
  77.   'set the height and width
  78.   Height = 3870
  79.   Width = 3156
  80.   Top = 0
  81.   Left = 0
  82.  
  83. End Sub
  84.  
  85. Sub Form_Paint ()
  86.   Outlines Me
  87. End Sub
  88.  
  89. Sub Form_Resize ()
  90.   On Error Resume Next
  91.  
  92.   If WindowState <> 1 Then
  93.     cTableList.Height = Height - 1350
  94.     cTableList.Width = Width - 320
  95.     Outlines Me
  96.     Me.Refresh
  97.   End If
  98. End Sub
  99.  
  100. Sub Form_Unload (Cancel As Integer)
  101.   Me.WindowState = 1
  102.   Cancel = True
  103. End Sub
  104.  
  105. Sub NewTableButton_Click ()
  106.   If gfDBOpenFlag = False Then
  107.     MsgBox "No DataBase Open", 48
  108.     Exit Sub
  109.   End If
  110.  
  111.   gfAddTableFlag = True
  112.   fTblStru.Show MODAL
  113. End Sub
  114.  
  115. Sub OpenButton_Click ()
  116.   On Error Resume Next
  117.   Dim qd As QueryDef
  118.   Dim iTableType As Integer
  119.   Dim ActionQuery As String
  120.  
  121.  
  122.   If cTableList = "" Then
  123.     MsgBox "No Table Selected", 48
  124.     Exit Sub
  125.   End If
  126.  
  127.   gfFromSQL = False
  128.  
  129.   SetHourglass Me
  130.  
  131.   iTableType = TableType((cTableList))
  132.  
  133.   'check to see if the selected table is
  134.   'actually a querydef in an Access database
  135.   'and display the SQL if pref is set
  136.   If gstDataType = "MS Access" Then
  137.     If iTableType = DB_QUERYDEF Then
  138.       Set qd = gCurrentDB.OpenQueryDef(cTableList)
  139.       ActionQuery = ActionQueryType((cTableList))
  140.       If VDMDI.PrefDisplaySQL.Checked = True Then
  141.         fSQL.cSQLStatement = qd.SQL
  142.       End If
  143.     End If
  144.   End If
  145.  
  146.   'create a new dynaset form
  147.   gstDynaString = ""
  148.   If VDMDI.cSingleRecord = True Then
  149.     If iTableType = DB_QUERYDEF Then
  150.       If ActionQuery = "" Then
  151.         MsgBar "Opening Query Dynaset", True
  152.         Dim dsform1 As New fDynaset
  153.         dsform1.Show
  154.       Else
  155.         ResetMouse Me
  156.         If MsgBox("Run " + ActionQuery + " Query?", MSGBOX_TYPE) = YES Then
  157.           SetHourglass Me
  158.           MsgBar "Executing " + ActionQuery + " Query", True
  159.           qd.Execute
  160.         End If
  161.       End If
  162.     ElseIf iTableType = DB_ATTACHEDTABLE Then
  163.       MsgBar "Opening Dynaset on Attached Table", True
  164.       Dim dsform2 As New fDynaset
  165.       dsform2.Show
  166.     ElseIf iTableType = DB_ATTACHEDODBC Then
  167.       MsgBar "Opening Dynaset on Attached ODBC Table", True
  168.       Dim dsform3 As New fDynaset
  169.       dsform3.Show
  170.     ElseIf gstDataType = "ODBC" Then
  171.       MsgBar "Opening Dynaset on ODBC Table", True
  172.       Dim dsform4 As New fDynaset
  173.       dsform4.Show
  174.     Else
  175.       MsgBar "Opening Table", True
  176.       Dim tblform As New fTableObj
  177.       tblform.Show
  178.     End If
  179.   ElseIf ActionQuery <> "" Then
  180.     ResetMouse Me
  181.     Beep
  182.     MsgBox "Action Query Not Allowed w/ Data Control or Grid!", 16
  183.   ElseIf VDMDI.cDataCtl = True Then
  184.     MsgBar "Opening Full Table Dynaset w/ Data Control", True
  185.     Dim dsform5 As New fDataForm
  186.     dsform5.Show
  187.   Else
  188.     MsgBar "Opening Full Table Dynaset in Grid", True
  189.     Dim dsgrid As New fGridFrm
  190.     dsgrid.Show
  191.   End If
  192.  
  193.   ResetMouse Me
  194.   MsgBar "", False
  195.  
  196. End Sub
  197.  
  198. Sub StructButton_Click ()
  199.   On Error Resume Next
  200.  
  201.   If cTableList = "" Then
  202.     MsgBox "No Table Selected", 48
  203.     Exit Sub
  204.   End If
  205.  
  206.   gfAddTableFlag = False
  207.   fTblStru.Show MODAL
  208. End Sub
  209.  
  210. Sub TableListLabel_DblClick ()
  211.    RefreshTables cTableList, True
  212. End Sub
  213.  
  214.