home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l407 / 5.ddi / TABLES.FR_ / TABLES.bin (.txt)
Encoding:
Visual Basic Form  |  1993-04-28  |  5.1 KB  |  187 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. Option Explicit
  64. Sub cTableList_DblClick ()
  65.   gfFromSQL = False
  66.   Call OpenButton_Click
  67. End Sub
  68. Sub Form_Load ()
  69.   If gfDBOpenFlag = True Then
  70.     Caption = gstDBName + "." + gstDataBase
  71.   End If
  72.   'set the height and width
  73.   Height = 3870
  74.   Width = 3156
  75.   Top = 0
  76.   Left = 0
  77. End Sub
  78. Sub Form_Paint ()
  79.   Outlines Me
  80. End Sub
  81. Sub Form_Resize ()
  82.   On Error Resume Next
  83.   If WindowState <> 1 Then
  84.     cTableList.Height = Height - 1350
  85.     cTableList.Width = Width - 320
  86.     Outlines Me
  87.     Me.Refresh
  88.   End If
  89. End Sub
  90. Sub Form_Unload (Cancel As Integer)
  91.   Me.WindowState = 1
  92.   Cancel = True
  93. End Sub
  94. Sub NewTableButton_Click ()
  95.   If gfDBOpenFlag = False Then
  96.     MsgBox "No DataBase Open", 48
  97.     Exit Sub
  98.   End If
  99.   gfAddTableFlag = True
  100.   fTblStru.Show MODAL
  101. End Sub
  102. Sub OpenButton_Click ()
  103.   On Error Resume Next
  104.   Dim qd As QueryDef
  105.   Dim iTableType As Integer
  106.   Dim ActionQuery As String
  107.   If cTableList = "" Then
  108.     MsgBox "No Table Selected", 48
  109.     Exit Sub
  110.   End If
  111.   gfFromSQL = False
  112.   SetHourglass Me
  113.   iTableType = TableType((cTableList))
  114.   'check to see if the selected table is
  115.   'actually a querydef in an Access database
  116.   'and display the SQL if pref is set
  117.   If gstDataType = "MS Access" Then
  118.     If iTableType = DB_QUERYDEF Then
  119.       Set qd = gCurrentDB.OpenQueryDef(cTableList)
  120.       ActionQuery = ActionQueryType((cTableList))
  121.       If VDMDI.PrefDisplaySQL.Checked = True Then
  122.         fSQL.cSQLStatement = qd.SQL
  123.       End If
  124.     End If
  125.   End If
  126.   'create a new dynaset form
  127.   gstDynaString = ""
  128.   If VDMDI.cSingleRecord = True Then
  129.     If iTableType = DB_QUERYDEF Then
  130.       If ActionQuery = "" Then
  131.         MsgBar "Opening Query Dynaset", True
  132.         Dim dsform1 As New fDynaset
  133.         dsform1.Show
  134.       Else
  135.         ResetMouse Me
  136.         If MsgBox("Run " + ActionQuery + " Query?", MSGBOX_TYPE) = YES Then
  137.           SetHourglass Me
  138.           MsgBar "Executing " + ActionQuery + " Query", True
  139.           qd.Execute
  140.         End If
  141.       End If
  142.     ElseIf iTableType = DB_ATTACHEDTABLE Then
  143.       MsgBar "Opening Dynaset on Attached Table", True
  144.       Dim dsform2 As New fDynaset
  145.       dsform2.Show
  146.     ElseIf iTableType = DB_ATTACHEDODBC Then
  147.       MsgBar "Opening Dynaset on Attached ODBC Table", True
  148.       Dim dsform3 As New fDynaset
  149.       dsform3.Show
  150.     ElseIf gstDataType = "ODBC" Then
  151.       MsgBar "Opening Dynaset on ODBC Table", True
  152.       Dim dsform4 As New fDynaset
  153.       dsform4.Show
  154.     Else
  155.       MsgBar "Opening Table", True
  156.       Dim tblform As New fTableObj
  157.       tblform.Show
  158.     End If
  159.   ElseIf ActionQuery <> "" Then
  160.     ResetMouse Me
  161.     Beep
  162.     MsgBox "Action Query Not Allowed w/ Data Control or Grid!", 16
  163.   ElseIf VDMDI.cDataCtl = True Then
  164.     MsgBar "Opening Full Table Dynaset w/ Data Control", True
  165.     Dim dsform5 As New fDataForm
  166.     dsform5.Show
  167.   Else
  168.     MsgBar "Opening Full Table Dynaset in Grid", True
  169.     Dim dsgrid As New fGridFrm
  170.     dsgrid.Show
  171.   End If
  172.   ResetMouse Me
  173.   MsgBar "", False
  174. End Sub
  175. Sub StructButton_Click ()
  176.   On Error Resume Next
  177.   If cTableList = "" Then
  178.     MsgBox "No Table Selected", 48
  179.     Exit Sub
  180.   End If
  181.   gfAddTableFlag = False
  182.   fTblStru.Show MODAL
  183. End Sub
  184. Sub TableListLabel_DblClick ()
  185.    RefreshTables cTableList, True
  186. End Sub
  187.