home *** CD-ROM | disk | FTP | other *** search
/ Master 95 #1 / MASTER95_1.iso / microsof / vbasic4 / vb4-6.cab / vdmdi.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-07-26  |  40.0 KB  |  1,340 lines

  1. VERSION 4.00
  2. Begin VB.MDIForm frmMDI 
  3.    BackColor       =   &H00808000&
  4.    Caption         =   "VisData"
  5.    ClientHeight    =   4140
  6.    ClientLeft      =   1050
  7.    ClientTop       =   1710
  8.    ClientWidth     =   10185
  9.    Height          =   4830
  10.    HelpContextID   =   2016116
  11.    Icon            =   "VDMDI.frx":0000
  12.    Left            =   990
  13.    LinkTopic       =   "MDIForm1"
  14.    LockControls    =   -1  'True
  15.    Top             =   1080
  16.    Width           =   10305
  17.    Begin VB.PictureBox picStatusBar 
  18.       Align           =   2  'Align Bottom
  19.       Appearance      =   0  'Flat
  20.       BorderStyle     =   0  'None
  21.       ForeColor       =   &H80000008&
  22.       Height          =   395
  23.       Left            =   0
  24.       ScaleHeight     =   390
  25.       ScaleWidth      =   10185
  26.       TabIndex        =   13
  27.       TabStop         =   0   'False
  28.       Top             =   3750
  29.       Width           =   10185
  30.       Begin VB.TextBox txtStatusMsg 
  31.          BackColor       =   &H8000000F&
  32.          Height          =   285
  33.          Left            =   60
  34.          TabIndex        =   19
  35.          TabStop         =   0   'False
  36.          Text            =   "Ready"
  37.          Top             =   60
  38.          Width           =   10065
  39.       End
  40.    End
  41.    Begin VB.PictureBox picToolBar 
  42.       Align           =   1  'Align Top
  43.       Appearance      =   0  'Flat
  44.       ForeColor       =   &H80000008&
  45.       Height          =   735
  46.       Left            =   0
  47.       ScaleHeight     =   715.842
  48.       ScaleMode       =   0  'User
  49.       ScaleWidth      =   10174.6
  50.       TabIndex        =   14
  51.       TabStop         =   0   'False
  52.       Top             =   0
  53.       Width           =   10185
  54.       Begin VB.PictureBox picFormType 
  55.          Appearance      =   0  'Flat
  56.          BorderStyle     =   0  'None
  57.          ForeColor       =   &H80000008&
  58.          Height          =   735
  59.          Left            =   3000
  60.          ScaleHeight     =   735
  61.          ScaleWidth      =   2175
  62.          TabIndex        =   15
  63.          TabStop         =   0   'False
  64.          Top             =   0
  65.          Width           =   2175
  66.          Begin VB.OptionButton optDataGrid 
  67.             Caption         =   "DBGrid Control"
  68.             Height          =   255
  69.             Left            =   0
  70.             TabIndex        =   6
  71.             Top             =   460
  72.             Width           =   1935
  73.          End
  74.          Begin VB.OptionButton optNoDataCtl 
  75.             Caption         =   "No Data Control"
  76.             Height          =   255
  77.             Left            =   0
  78.             TabIndex        =   5
  79.             Top             =   220
  80.             Width           =   1935
  81.          End
  82.          Begin VB.OptionButton optDataCtl 
  83.             Caption         =   "Data Control"
  84.             Height          =   255
  85.             Left            =   0
  86.             TabIndex        =   4
  87.             Top             =   0
  88.             Value           =   -1  'True
  89.             Width           =   1575
  90.          End
  91.       End
  92.       Begin VB.PictureBox picRSType 
  93.          Appearance      =   0  'Flat
  94.          BackColor       =   &H00C0C0C0&
  95.          BorderStyle     =   0  'None
  96.          ForeColor       =   &H80000008&
  97.          Height          =   735
  98.          Left            =   840
  99.          ScaleHeight     =   735
  100.          ScaleWidth      =   1335
  101.          TabIndex        =   16
  102.          TabStop         =   0   'False
  103.          Top             =   0
  104.          Width           =   1335
  105.          Begin VB.OptionButton optPassThru 
  106.             Caption         =   "PassThrough"
  107.             Height          =   255
  108.             Left            =   0
  109.             TabIndex        =   2
  110.             Top             =   460
  111.             Value           =   -1  'True
  112.             Visible         =   0   'False
  113.             Width           =   1350
  114.          End
  115.          Begin VB.OptionButton optTable 
  116.             Caption         =   "Table"
  117.             Height          =   255
  118.             Left            =   0
  119.             TabIndex        =   3
  120.             Top             =   460
  121.             Width           =   870
  122.          End
  123.          Begin VB.OptionButton optDynaset 
  124.             Caption         =   "Dynaset"
  125.             Height          =   255
  126.             Left            =   0
  127.             TabIndex        =   0
  128.             Top             =   0
  129.             Width           =   1335
  130.          End
  131.          Begin VB.OptionButton optSnapshot 
  132.             Caption         =   "Snapshot"
  133.             Height          =   255
  134.             Left            =   0
  135.             TabIndex        =   1
  136.             Top             =   220
  137.             Width           =   1335
  138.          End
  139.       End
  140.       Begin VB.CommandButton cmdBeginTrans 
  141.          Caption         =   "BeginTrans"
  142.          Height          =   369
  143.          Left            =   5280
  144.          TabIndex        =   7
  145.          Top             =   0
  146.          Width           =   1695
  147.       End
  148.       Begin VB.CommandButton cmdRollback 
  149.          Caption         =   "Rollback"
  150.          Height          =   369
  151.          Left            =   6600
  152.          TabIndex        =   9
  153.          Top             =   0
  154.          Visible         =   0   'False
  155.          Width           =   1335
  156.       End
  157.       Begin VB.CommandButton cmdCommitTrans 
  158.          Caption         =   "CommitTrans"
  159.          Height          =   369
  160.          Left            =   5280
  161.          TabIndex        =   8
  162.          Top             =   0
  163.          Visible         =   0   'False
  164.          Width           =   1335
  165.       End
  166.       Begin VB.Line Line1 
  167.          X1              =   2339.507
  168.          X2              =   2339.507
  169.          Y1              =   10.154
  170.          Y2              =   680.304
  171.       End
  172.       Begin VB.Label lblToolLabels 
  173.          AutoSize        =   -1  'True
  174.          Caption         =   "Type:"
  175.          Height          =   195
  176.          Index           =   3
  177.          Left            =   2400
  178.          TabIndex        =   18
  179.          Top             =   240
  180.          Width           =   405
  181.       End
  182.       Begin VB.Label lblToolLabels 
  183.          AutoSize        =   -1  'True
  184.          Caption         =   "Type:"
  185.          Height          =   195
  186.          Index           =   2
  187.          Left            =   45
  188.          TabIndex        =   17
  189.          Top             =   240
  190.          Width           =   405
  191.       End
  192.       Begin MSComDlg.CommonDialog dlgCMD1 
  193.          Left            =   8040
  194.          Top             =   240
  195.          _Version        =   65536
  196.          _ExtentX        =   847
  197.          _ExtentY        =   847
  198.          _StockProps     =   0
  199.       End
  200.       Begin VB.Label lblUser 
  201.          AutoSize        =   -1  'True
  202.          BorderStyle     =   1  'Fixed Single
  203.          Caption         =   " User: "
  204.          Height          =   225
  205.          Left            =   5280
  206.          TabIndex        =   10
  207.          Top             =   414
  208.          Width           =   495
  209.       End
  210.       Begin VB.Label lblToolLabels 
  211.          AutoSize        =   -1  'True
  212.          Caption         =   "Recordset"
  213.          Height          =   195
  214.          Index           =   1
  215.          Left            =   45
  216.          TabIndex        =   11
  217.          Top             =   15
  218.          Width           =   735
  219.       End
  220.       Begin VB.Label lblToolLabels 
  221.          AutoSize        =   -1  'True
  222.          Caption         =   "Form"
  223.          Height          =   195
  224.          Index           =   0
  225.          Left            =   2400
  226.          TabIndex        =   12
  227.          Top             =   15
  228.          Width           =   345
  229.       End
  230.    End
  231.    Begin VB.Menu mnuDatabase 
  232.       Caption         =   "&File"
  233.       Begin VB.Menu mnuDBOpen 
  234.          Caption         =   "&Open DataBase..."
  235.          HelpContextID   =   2016062
  236.          Begin VB.Menu mnuDBOJet 
  237.             Caption         =   "&Jet Engine MDB..."
  238.          End
  239.          Begin VB.Menu mnuDBODbase 
  240.             Caption         =   "&Dbase"
  241.             Begin VB.Menu mnuDBOdBASE4 
  242.                Caption         =   "I&V..."
  243.             End
  244.             Begin VB.Menu mnuDBOdBASE3 
  245.                Caption         =   "&III..."
  246.             End
  247.          End
  248.          Begin VB.Menu mnuDBOFoxPro 
  249.             Caption         =   "&FoxPro"
  250.             Begin VB.Menu mnuDBOFox26 
  251.                Caption         =   "2.&6..."
  252.             End
  253.             Begin VB.Menu mnuDBOFox25 
  254.                Caption         =   "2.&5..."
  255.             End
  256.             Begin VB.Menu mnuDBOFox20 
  257.                Caption         =   "2.&0..."
  258.             End
  259.          End
  260.          Begin VB.Menu mnuDBOParadox 
  261.             Caption         =   "&Paradox"
  262.             Begin VB.Menu mnuDBOParadox4 
  263.                Caption         =   "&4.X..."
  264.             End
  265.             Begin VB.Menu mnuDBOParadox3 
  266.                Caption         =   "&3.X..."
  267.             End
  268.          End
  269.          Begin VB.Menu mnuDBOBtrieve 
  270.             Caption         =   "&Btrieve..."
  271.          End
  272.          Begin VB.Menu mnuDBOExcel 
  273.             Caption         =   "&Excel..."
  274.          End
  275.          Begin VB.Menu mnuDBOText 
  276.             Caption         =   "&Text Files..."
  277.          End
  278.          Begin VB.Menu mnuDBOODBC 
  279.             Caption         =   "&ODBC..."
  280.          End
  281.       End
  282.       Begin VB.Menu mnuDBClose 
  283.          Caption         =   "&Close DataBase"
  284.          HelpContextID   =   2016079
  285.          Visible         =   0   'False
  286.       End
  287.       Begin VB.Menu mnuDBWorkspace 
  288.          Caption         =   "&Workspace..."
  289.          HelpContextID   =   2016080
  290.       End
  291.       Begin VB.Menu mnuDBErrors 
  292.          Caption         =   "&Errors..."
  293.          HelpContextID   =   2016081
  294.       End
  295.       Begin VB.Menu mnuDBProperties 
  296.          Caption         =   "&Properties..."
  297.          HelpContextID   =   2016082
  298.          Visible         =   0   'False
  299.          Begin VB.Menu mnuDBPEngine 
  300.             Caption         =   "DB&Engine..."
  301.          End
  302.          Begin VB.Menu mnuDBPWorkspace 
  303.             Caption         =   "&Workspace..."
  304.          End
  305.          Begin VB.Menu mnuDBPDatabase 
  306.             Caption         =   "&Database..."
  307.          End
  308.       End
  309.       Begin VB.Menu mnuDBNew 
  310.          Caption         =   "&New..."
  311.          HelpContextID   =   2016083
  312.          Begin VB.Menu mnuDBNJet 
  313.             Caption         =   "&Jet Engine MDB"
  314.             Begin VB.Menu mnuDBNJet11 
  315.                Caption         =   "Version &1.1 MDB..."
  316.             End
  317.             Begin VB.Menu mnuDBNJet2x 
  318.                Caption         =   "Version &2.0 MDB..."
  319.             End
  320.             Begin VB.Menu mnuDBNJet30 
  321.                Caption         =   "Version &3.0 MDB..."
  322.             End
  323.          End
  324.          Begin VB.Menu mnuDBNDbase 
  325.             Caption         =   "&Dbase"
  326.             Begin VB.Menu mnuDBNdBASE4 
  327.                Caption         =   "I&V..."
  328.             End
  329.             Begin VB.Menu mnuDBNdBASE3 
  330.                Caption         =   "&III..."
  331.             End
  332.          End
  333.          Begin VB.Menu mnuDBNFoxPro 
  334.             Caption         =   "&FoxPro"
  335.             Begin VB.Menu mnuDBNFox26 
  336.                Caption         =   "2.&6..."
  337.             End
  338.             Begin VB.Menu mnuDBNFox25 
  339.                Caption         =   "2.&5..."
  340.             End
  341.             Begin VB.Menu mnuDBNFox20 
  342.                Caption         =   "2.&0..."
  343.             End
  344.          End
  345.          Begin VB.Menu mnuDBNParadox 
  346.             Caption         =   "&Paradox"
  347.             Begin VB.Menu mnuDBNParadox4 
  348.                Caption         =   "&4.X..."
  349.             End
  350.             Begin VB.Menu mnuDBNParadox3 
  351.                Caption         =   "&3.X..."
  352.             End
  353.          End
  354.          Begin VB.Menu mnuDBNBtrieve 
  355.             Caption         =   "&Btrieve..."
  356.          End
  357.          Begin VB.Menu mnuDBNODBC 
  358.             Caption         =   "&ODBC..."
  359.          End
  360.          Begin VB.Menu mnuDBNText 
  361.             Caption         =   "&Text Files..."
  362.          End
  363.       End
  364.       Begin VB.Menu mnuBar1 
  365.          Caption         =   "-"
  366.       End
  367.       Begin VB.Menu mnuDBCompact 
  368.          Caption         =   "Co&mpact MDB..."
  369.          HelpContextID   =   2016084
  370.          Begin VB.Menu mnuDBC30MDB 
  371.             Caption         =   "&3.0 MDB..."
  372.          End
  373.          Begin VB.Menu mnuDBC20MDB 
  374.             Caption         =   "&2.0 MDB..."
  375.          End
  376.          Begin VB.Menu mnuDBC11MDB 
  377.             Caption         =   "&1.1 MDB..."
  378.          End
  379.       End
  380.       Begin VB.Menu mnuDBRepair 
  381.          Caption         =   "&Repair MDB..."
  382.          HelpContextID   =   2016085
  383.       End
  384.       Begin VB.Menu mnuBar2 
  385.          Caption         =   "-"
  386.       End
  387.       Begin VB.Menu mnuDBMRU 
  388.          Caption         =   "&1"
  389.          Index           =   1
  390.          Visible         =   0   'False
  391.       End
  392.       Begin VB.Menu mnuDBMRU 
  393.          Caption         =   "&2"
  394.          Index           =   2
  395.          Visible         =   0   'False
  396.       End
  397.       Begin VB.Menu mnuDBMRU 
  398.          Caption         =   "&3"
  399.          Index           =   3
  400.          Visible         =   0   'False
  401.       End
  402.       Begin VB.Menu mnuDBMRU 
  403.          Caption         =   "&4"
  404.          Index           =   4
  405.          Visible         =   0   'False
  406.       End
  407.       Begin VB.Menu mnuBarMRU 
  408.          Caption         =   "-"
  409.          Visible         =   0   'False
  410.       End
  411.       Begin VB.Menu mnuDBMakeAddIn 
  412.          Caption         =   "Make &VisData a VB Add-In"
  413.          HelpContextID   =   2018516
  414.       End
  415.       Begin VB.Menu mnuDBExit 
  416.          Caption         =   "E&xit"
  417.       End
  418.    End
  419.    Begin VB.Menu mnuJet 
  420.       Caption         =   "&Jet"
  421.       Visible         =   0   'False
  422.       Begin VB.Menu mnuJAttachments 
  423.          Caption         =   "&Attachments.."
  424.          HelpContextID   =   2016086
  425.       End
  426.       Begin VB.Menu mnuJRelations 
  427.          Caption         =   "&Relations..."
  428.          HelpContextID   =   2016087
  429.       End
  430.       Begin VB.Menu mnuJGroupsUsers 
  431.          Caption         =   "&Groups/Users..."
  432.          HelpContextID   =   2016088
  433.       End
  434.       Begin VB.Menu mnuBarJet 
  435.          Caption         =   "-"
  436.       End
  437.       Begin VB.Menu mnuJMUSettings 
  438.          Caption         =   "&Multiuser Settings..."
  439.          HelpContextID   =   2016089
  440.       End
  441.       Begin VB.Menu mnuJSystemDB 
  442.          Caption         =   "&SYSTEM.MDA..."
  443.          HelpContextID   =   2016090
  444.       End
  445.    End
  446.    Begin VB.Menu mnuUtil 
  447.       Caption         =   "&Utility"
  448.       Visible         =   0   'False
  449.       Begin VB.Menu mnuUQuery 
  450.          Caption         =   "&Query Builder..."
  451.          HelpContextID   =   2016115
  452.       End
  453.       Begin VB.Menu mnuUDataFormDesigner 
  454.          Caption         =   "Data &Form Designer..."
  455.          HelpContextID   =   2018517
  456.          Visible         =   0   'False
  457.       End
  458.       Begin VB.Menu mnuUReplace 
  459.          Caption         =   "&Global Replace..."
  460.          HelpContextID   =   2016091
  461.       End
  462.       Begin VB.Menu mnuUImpExp 
  463.          Caption         =   "&Import/Export..."
  464.          HelpContextID   =   2016092
  465.       End
  466.       Begin VB.Menu mnuUListCombo 
  467.          Caption         =   "&DBList/DBCombo View..."
  468.          HelpContextID   =   2016093
  469.       End
  470.       Begin VB.Menu mnuBar3 
  471.          Caption         =   "-"
  472.       End
  473.       Begin VB.Menu mnuUCloseAll 
  474.          Caption         =   "Close All &Recordset Forms"
  475.          HelpContextID   =   2016094
  476.       End
  477.       Begin VB.Menu mnuUClosePropForms 
  478.          Caption         =   "Close All &Property Forms"
  479.          HelpContextID   =   2016094
  480.       End
  481.       Begin VB.Menu mnuUCloseListComboForms 
  482.          Caption         =   "Close All DBList/&DBCombo Forms"
  483.          HelpContextID   =   2016094
  484.       End
  485.    End
  486.    Begin VB.Menu mnuPref 
  487.       Caption         =   "&Preferences"
  488.       Begin VB.Menu mnuPOpenOnStartup 
  489.          Caption         =   "&Open Last DataBase on Startup"
  490.          HelpContextID   =   2016095
  491.       End
  492.       Begin VB.Menu mnuPShowPerf 
  493.          Caption         =   "&Show Performance Numbers"
  494.          HelpContextID   =   2016096
  495.       End
  496.       Begin VB.Menu mnuPAllowSys 
  497.          Caption         =   "&Include System Tables"
  498.          HelpContextID   =   2016097
  499.       End
  500.       Begin VB.Menu mnuBar4 
  501.          Caption         =   "-"
  502.       End
  503.       Begin VB.Menu mnuPQueryTimeout 
  504.          Caption         =   "&Query Timeout Value..."
  505.          HelpContextID   =   2016098
  506.       End
  507.       Begin VB.Menu mnuPLoginTimeout 
  508.          Caption         =   "&Login Timeout Value..."
  509.          HelpContextID   =   2016099
  510.       End
  511.    End
  512.    Begin VB.Menu mnuWindow 
  513.       Caption         =   "&Window"
  514.       HelpContextID   =   2016100
  515.       Begin VB.Menu mnuWTile 
  516.          Caption         =   "&Tile"
  517.       End
  518.       Begin VB.Menu mnuWCascade 
  519.          Caption         =   "&Cascade"
  520.       End
  521.       Begin VB.Menu mnuWArrange 
  522.          Caption         =   "&Arrange Icons"
  523.       End
  524.       Begin VB.Menu mnuBar6 
  525.          Caption         =   "-"
  526.       End
  527.       Begin VB.Menu mnuWMDI 
  528.          Caption         =   "&Main MDI"
  529.       End
  530.       Begin VB.Menu mnuWTableList 
  531.          Caption         =   "Ta&bles"
  532.       End
  533.       Begin VB.Menu mnuWSQL 
  534.          Caption         =   "&SQL"
  535.       End
  536.    End
  537.    Begin VB.Menu mnuHelp 
  538.       Caption         =   "&Help"
  539.       Begin VB.Menu mnuHContents 
  540.          Caption         =   "&Contents..."
  541.       End
  542.       Begin VB.Menu mnuHSearch 
  543.          Caption         =   "&Search..."
  544.       End
  545.       Begin VB.Menu mnuBar7 
  546.          Caption         =   "-"
  547.       End
  548.       Begin VB.Menu mnuHAbout 
  549.          Caption         =   "&About..."
  550.       End
  551.    End
  552.    Begin VB.Menu mnuPopUp 
  553.       Caption         =   "PopUp"
  554.       Visible         =   0   'False
  555.       Begin VB.Menu mnuPUProperties 
  556.          Caption         =   "Properties..."
  557.       End
  558.       Begin VB.Menu mnuPURename 
  559.          Caption         =   "Rename..."
  560.       End
  561.       Begin VB.Menu mnuPUDelete 
  562.          Caption         =   "Delete"
  563.       End
  564.       Begin VB.Menu mnuBarPopUp1 
  565.          Caption         =   "-"
  566.       End
  567.       Begin VB.Menu mnuPUCopyStruct 
  568.          Caption         =   "Copy Structure..."
  569.       End
  570.       Begin VB.Menu mnuPUZap 
  571.          Caption         =   "Remove All Records"
  572.          Visible         =   0   'False
  573.       End
  574.       Begin VB.Menu mnuPUPack 
  575.          Caption         =   "Pack XBase Table..."
  576.          Enabled         =   0   'False
  577.          Visible         =   0   'False
  578.       End
  579.       Begin VB.Menu mnuPURefresh 
  580.          Caption         =   "Refresh List"
  581.       End
  582.    End
  583. Attribute VB_Name = "frmMDI"
  584. Attribute VB_Creatable = False
  585. Attribute VB_Exposed = False
  586. Option Explicit
  587. Option Compare Binary
  588. Private Sub cmdBeginTrans_Click()
  589.   On Error GoTo BeginErr
  590.   If gbDBOpenFlag = False Then
  591.     MsgBox "No Database Open", 48
  592.     Exit Sub
  593.   End If
  594.   If gdbCurrentDB.Transactions = False Then
  595.     Beep
  596.     MsgBox "Transactions not supported by this Driver!"
  597.     Exit Sub
  598.   End If
  599.   gwsMainWS.BeginTrans
  600.   gbDBChanged = False
  601.   gbTransPending = True
  602.   cmdBeginTrans.Visible = False
  603.   cmdCommitTrans.Visible = True
  604.   cmdRollback.Visible = True
  605.   cmdCommitTrans.SetFocus
  606.   Exit Sub
  607. BeginErr:
  608.   ShowError
  609.   Exit Sub
  610. End Sub
  611. Private Sub cmdCommitTrans_Click()
  612.   On Error GoTo CommitErr
  613.   gwsMainWS.CommitTrans
  614.   gbDBChanged = False
  615.   gbTransPending = False
  616.   cmdBeginTrans.Visible = True
  617.   cmdCommitTrans.Visible = False
  618.   cmdRollback.Visible = False
  619.   cmdBeginTrans.SetFocus
  620.   Exit Sub
  621. CommitErr:
  622.   ShowError
  623.   Exit Sub
  624. End Sub
  625. Private Sub cmdRollback_Click()
  626.   On Error GoTo RollbackErr
  627.   If MsgBox("All changes will be gone, Rollback anyway?", gnMSGBOX_TYPE) = gnMSGBOX_YES Then
  628.     gwsMainWS.Rollback
  629.     gbDBChanged = False
  630.     gbTransPending = False
  631.     cmdBeginTrans.Visible = True
  632.     cmdCommitTrans.Visible = False
  633.     cmdRollback.Visible = False
  634.     cmdBeginTrans.SetFocus
  635.   End If
  636.   Exit Sub
  637. RollbackErr:
  638.   ShowError
  639.   Exit Sub
  640. End Sub
  641. Private Sub lblUser_MouseUp(Button As Integer, Shift As Integer, x As Single, Y As Single)
  642.   If Button <> 2 Then Exit Sub
  643.   SetHourglass
  644.   ShowProperties "User", gwsMainWS.Users(gwsMainWS.UserName)
  645. End Sub
  646. Private Sub MDIForm_Resize()
  647.   If Me.WindowState <> vbMinimized Then
  648.     txtStatusMsg.Width = Me.Width - 240
  649.   End If
  650. End Sub
  651. #If Win32 Then
  652. Private Sub mnuDBC30MDB_Click()
  653.   CompactDB dbVersion30
  654. End Sub
  655. #End If
  656. Private Sub mnuDBNJet11_Click()
  657.   NewJetMDB dbVersion11
  658. End Sub
  659. Private Sub mnuDBNJet2x_Click()
  660.   NewJetMDB dbVersion20
  661. End Sub
  662. #If Win32 Then
  663. Private Sub mnuDBNJet30_Click()
  664.   NewJetMDB dbVersion30
  665. End Sub
  666. #End If
  667. Private Sub mnuDBOExcel_Click()
  668.   'we can use Excel 5.0 for all Excel files because
  669.   'the ISAM will figure out the version when
  670.   'it opens file
  671.   gsDataType = gsEXCEL50
  672.   OpenLocalDB False
  673. End Sub
  674. Private Sub mnuHAbout_Click()
  675.   MsgBar "Press any key to Close About Box", False
  676.   frmAboutBox.Show vbModal
  677.   MsgBar gsNULL_STR, False
  678. End Sub
  679. Private Sub mnuDBC20MDB_Click()
  680.   CompactDB dbVersion20
  681. End Sub
  682. Private Sub mnuDBClose_Click()
  683.   CloseCurrentDB
  684. End Sub
  685. Private Sub mnuDBC11MDB_Click()
  686.   CompactDB dbVersion11
  687. End Sub
  688. Private Sub mnuDBErrors_Click()
  689.   On Error Resume Next
  690.   SetHourglass
  691.   RefreshErrors
  692.   Screen.MousePointer = vbDefault
  693.   If Err Then ShowError
  694. End Sub
  695. Private Sub mnuDBExit_Click()
  696.   Unload Me
  697. End Sub
  698. Private Sub mnuDBNBtrieve_Click()
  699.    gsDataType = gsBTRIEVE
  700.    NewLocalISAM
  701. End Sub
  702. Private Sub mnuDBNDbase3_Click()
  703.    gsDataType = gsDBASEIII
  704.    NewLocalISAM
  705. End Sub
  706. Private Sub mnuDBNDbase4_Click()
  707.    gsDataType = gsDBASEIV
  708.    NewLocalISAM
  709. End Sub
  710. Private Sub mnuDBNFox20_Click()
  711.    gsDataType = gsFOXPRO20
  712.    NewLocalISAM
  713. End Sub
  714. Private Sub mnuDBNFox25_Click()
  715.    gsDataType = gsFOXPRO25
  716.    NewLocalISAM
  717. End Sub
  718. Private Sub mnuDBNFox26_Click()
  719.    gsDataType = gsFOXPRO26
  720.    NewLocalISAM
  721. End Sub
  722. Private Sub mnuDBNODBC_Click()
  723.   On Error GoTo DBNErr
  724.   Dim sDriverName As String
  725.   MsgBar "Enter New Database Parameters", False
  726.   'driver must be an valid entry in ODBCINST.INI
  727.   sDriverName = InputBox("Enter Driver Name from ODBCINST.INI File:", "Driver Name", gsDEFAULT_DRIVER)
  728.   DBEngine.RegisterDatabase gsNULL_STR, sDriverName, False, gsNULL_STR
  729.   SendKeys "%FOO"   'force open database dialog
  730.   MsgBar gsNULL_STR, False
  731.   Exit Sub
  732. DBNErr:
  733.   ShowError
  734.   Exit Sub
  735. End Sub
  736. Private Sub mnuDBNParadox3_Click()
  737.    gsDataType = gsPARADOX3X
  738.    NewLocalISAM
  739. End Sub
  740. Private Sub mnuDBNParadox4_Click()
  741.    gsDataType = gsPARADOX4X
  742.    NewLocalISAM
  743. End Sub
  744. Private Sub mnuDBNText_Click()
  745.    gsDataType = gsTEXTFILES
  746.    NewLocalISAM
  747. End Sub
  748. Private Sub mnuDBOJet_Click()
  749.    gsDataType = gsJETMDB
  750.    OpenLocalDB False
  751. End Sub
  752. Private Sub mnuDBOBtrieve_Click()
  753.    gsDataType = gsBTRIEVE
  754.    OpenLocalDB False
  755. End Sub
  756. Private Sub mnuDBODbase3_Click()
  757.    gsDataType = gsDBASEIII
  758.    OpenLocalDB False
  759. End Sub
  760. Private Sub mnuDBODbase4_Click()
  761.    gsDataType = gsDBASEIV
  762.    OpenLocalDB False
  763. End Sub
  764. Private Sub mnuDBOFox20_Click()
  765.    gsDataType = gsFOXPRO20
  766.    OpenLocalDB False
  767. End Sub
  768. Private Sub mnuDBOFox25_Click()
  769.    gsDataType = gsFOXPRO25
  770.    OpenLocalDB False
  771. End Sub
  772. Private Sub mnuDBOFox26_Click()
  773.    gsDataType = gsFOXPRO26
  774.    OpenLocalDB False
  775. End Sub
  776. Private Sub mnuDBOODBC_Click()
  777.    If gbDBOpenFlag = True Then
  778.      Call mnuDBClose_Click
  779.    End If
  780.    If gbDBOpenFlag = True Then
  781.      Beep
  782.      MsgBox "You must Close First!", 48
  783.    Else
  784.      frmOpenDB.Show vbModal
  785.    End If
  786.    If gbDBOpenFlag = True Then
  787.      ShowDBTools
  788.      RefreshTables frmTables.lstTables, True
  789.      MsgBar "NOTE: Use of Attached Tables is the Recommended Method", False
  790.    End If
  791. End Sub
  792. Private Sub mnuDBOParadox3_Click()
  793.    gsDataType = gsPARADOX3X
  794.    OpenLocalDB False
  795. End Sub
  796. Private Sub mnuDBOParadox4_Click()
  797.    gsDataType = gsPARADOX4X
  798.    OpenLocalDB False
  799. End Sub
  800. Private Sub mnuDBOText_Click()
  801.    gsDataType = gsTEXTFILES
  802.    OpenLocalDB False
  803. End Sub
  804. Private Sub mnuDBPDatabase_Click()
  805.   ShowProperties "Database", gdbCurrentDB
  806. End Sub
  807. Private Sub mnuDBPEngine_Click()
  808.   ShowProperties "DBEngine", DBEngine
  809. End Sub
  810. Private Sub mnuDBPWorkspace_Click()
  811.   ShowProperties "Workspace", gwsMainWS
  812. End Sub
  813. Private Sub mnuDBRepair_Click()
  814.   On Error GoTo RepairAccErr
  815.   Dim sNewName As String
  816.   'get file name to repair
  817.   With dlgCMD1
  818.     .Filter = "Jet Engine MDBs (*.mdb)|*.mdb|All Files (*.*)|*.*"
  819.     .DialogTitle = "Open Jet Database to Repair"
  820.     .FilterIndex = 1
  821.     .Flags = FileOpenConstants.cdlOFNHideReadOnly
  822.     .ShowOpen
  823.   End With
  824.   If Len(dlgCMD1.FileName) > 0 Then
  825.     sNewName = dlgCMD1.FileName
  826.   Else
  827.     Exit Sub
  828.   End If
  829.   SetHourglass
  830.   MsgBar "Repairing " & sNewName, True
  831.   DBEngine.RepairDatabase sNewName
  832.   Screen.MousePointer = vbDefault
  833.   MsgBar gsNULL_STR, False
  834.   If MsgBox("Open Repaired Database?", gnMSGBOX_TYPE) = gnMSGBOX_YES Then
  835.     If gbDBOpenFlag = True Then
  836.       Call mnuDBClose_Click
  837.     End If
  838.     gsDataType = gsJETMDB
  839.     gsDBName = sNewName
  840.     OpenLocalDB True
  841.   End If
  842.   If gbDBOpenFlag = True Then
  843.     ShowDBTools
  844.     RefreshTables frmTables.lstTables, True
  845.   End If
  846.   Exit Sub
  847. RepairAccErr:
  848.   If Err <> 32755 Then
  849.     ShowError
  850.   End If
  851.   Exit Sub
  852. End Sub
  853. Private Sub mnuHContents_Click()
  854.   On Error Resume Next
  855.   Dim nRet As Integer
  856.   nRet = OSWinHelp(Me.hwnd, App.HelpFile, HelpConstants.cdlHelpContents, 0)
  857.   If Err Then
  858.     ShowError
  859.   End If
  860. End Sub
  861. Private Sub mnuHSearch_Click()
  862.   On Error Resume Next
  863.   Dim nRet As Integer
  864.   nRet = OSWinHelp(Me.hwnd, App.HelpFile, HelpConstants.cdlHelpPartialKey, 0)
  865.   If Err Then
  866.     ShowError
  867.   End If
  868. End Sub
  869. Private Sub mnuJSystemDB_Click()
  870.   On Error Resume Next
  871.   Dim sTmp As String
  872.   Dim x As Integer
  873.   With dlgCMD1
  874.     .Filter = "SYSTEM.MDA|SYSTEM.MDA"
  875.     .DialogTitle = "Select SYSTEM.MDA (Jet Security File)"
  876.     .FilterIndex = 1
  877.     .FileName = "SYSTEM.MDA"
  878.     .CancelError = True
  879.     .Flags = FileOpenConstants.cdlOFNHideReadOnly + FileOpenConstants.cdlOFNFileMustExist
  880.   End With
  881.   On Error Resume Next
  882.   dlgCMD1.ShowOpen
  883.   If Err = 32755 Then         'user cancelled
  884.     Exit Sub
  885.   Else
  886.     sTmp = dlgCMD1.FileName  'must be a good filename
  887.     SaveSetting "VisData", "Engines\Jet", "SystemDB", sTmp
  888.     SaveSetting "VisData", gsVISDATA4, "LoadSystemDB", "Yes"
  889.   End If
  890. End Sub
  891. Private Sub mnuDBWorkspace_Click()
  892.   On Error GoTo WSErr
  893.   Dim sDBName As String
  894.   Dim sConnect As String
  895.   Dim sUser As String
  896.   If gbDBOpenFlag = True Then
  897.     'save the old settings
  898.     sDBName = gdbCurrentDB.Name
  899.     sConnect = gdbCurrentDB.Connect
  900.     sUser = gwsMainWS.UserName
  901.   End If
  902.   frmLogin.Show vbModal
  903.   lblUser.Caption = " User: " & gwsMainWS.UserName & " "
  904.   'reopen the database if the user changed
  905.   If UCase(sUser) <> UCase(gwsMainWS.UserName) And gbDBOpenFlag = True Then
  906.     'have to close objects that will be invalid after reopening the DB
  907.     CloseAllRecordsets
  908.     CloseAllPropForms
  909.     CloseAllListCombos
  910.     Set gdbCurrentDB = gwsMainWS.OpenDatabase(sDBName, False, gnReadOnly, sConnect)
  911.   End If
  912.   Exit Sub
  913. WSErr:
  914.   ShowError
  915.   If gbDBOpenFlag = True Then
  916.     MsgBox "Current Database must be closed due to the error!", 48
  917.   End If
  918.   Call mnuDBClose_Click
  919.   Exit Sub
  920. End Sub
  921. Private Sub mnuJAttachments_Click()
  922.   On Error Resume Next
  923.   SetHourglass
  924.   frmAttachments.Show
  925.   Screen.MousePointer = vbDefault
  926.   If Err Then ShowError
  927. End Sub
  928. Private Sub mnuJGroupsUsers_Click()
  929.   On Error Resume Next
  930.   If gwsMainWS.Users.Count = 0 Then
  931.     Beep
  932.     MsgBox "No Users found, try 'Jet/System MDA'!", 48
  933.     Exit Sub
  934.   End If
  935.   SetHourglass
  936.   frmGroupsUsers.Show
  937.   Screen.MousePointer = vbDefault
  938.   If Err Then ShowError
  939. End Sub
  940. Private Sub mnuJMUSettings_Click()
  941.   frmMUOptions.Show
  942. End Sub
  943. Private Sub mnuJRelations_Click()
  944.   On Error Resume Next
  945.   SetHourglass
  946.   frmRelations.Show
  947.   Screen.MousePointer = vbDefault
  948.   If Err Then ShowError
  949. End Sub
  950. Private Sub mnuPAllowSys_Click()
  951.   On Error Resume Next
  952.   If gbDBOpenFlag = False Then
  953.     MsgBox "No Database Open", 48
  954.     Exit Sub
  955.   End If
  956.   mnuPAllowSys.Checked = Not mnuPAllowSys.Checked
  957.   RefreshTables frmTables.lstTables, True
  958. End Sub
  959. Private Sub mnuPLoginTimeout_Click()
  960.   On Error GoTo LTErr
  961.   Dim sNewValue As String
  962.   sNewValue = InputBox("Login Timeout is currently " & glLoginTimeout & " seconds." & gsNewLine & "Enter New Value:")
  963.   If Len(sNewValue) = 0 Then Exit Sub
  964.   'try to set the new value
  965.   If Val(sNewValue) >= 0 Then
  966.     glLoginTimeout = Val(sNewValue)
  967.     DBEngine.LoginTimeout = glLoginTimeout
  968.   End If
  969.   Exit Sub
  970. LTErr:
  971.   ShowError
  972.   Exit Sub
  973. End Sub
  974. Private Sub mnuPOpenOnStartup_Click()
  975.   mnuPOpenOnStartup.Checked = Not mnuPOpenOnStartup.Checked
  976. End Sub
  977. Private Sub mnuPQueryTimeout_Click()
  978.   On Error GoTo QTErr
  979.   Dim sNewValue As String
  980.   If gbDBOpenFlag = False Then
  981.     MsgBox "No Database Open", 48
  982.     Exit Sub
  983.   End If
  984.   sNewValue = InputBox("Query Timeout is currently " & gdbCurrentDB.QueryTimeout & " seconds." & gsNewLine & "Enter New Value:")
  985.   If Len(sNewValue) = 0 Then Exit Sub
  986.   'try to set the new value
  987.   gdbCurrentDB.QueryTimeout = Val(sNewValue)
  988.   glQueryTimeout = Val(sNewValue)
  989.   Exit Sub
  990. QTErr:
  991.   ShowError
  992.   'reset the form control after the error
  993.   glQueryTimeout = gdbCurrentDB.QueryTimeout
  994.   Exit Sub
  995. End Sub
  996. Private Sub mnuPShowPerf_Click()
  997.   mnuPShowPerf.Checked = Not mnuPShowPerf.Checked
  998. End Sub
  999. Private Sub mnuUDataFormDesigner_Click()
  1000.   On Error Resume Next
  1001.   frmDFD.Show vbModal
  1002.   If Err Then ShowError
  1003. End Sub
  1004. Private Sub mnuDBMakeAddIn_Click()
  1005.   On Error Resume Next
  1006.   Dim sOSVer As String
  1007. #If Win16 Then
  1008.   sOSVer = "16"
  1009.   Dim x As Integer
  1010. #Else
  1011.   sOSVer = "32"
  1012.   Dim x As Long
  1013. #End If
  1014.   'try to register the VisData add-in stub
  1015.   x = Shell(App.Path & "\VDADD" & sOSVer & ".EXE /regserver")
  1016.   If Err Then
  1017.     MsgBox "See SAMPLES.HLP for instructions.", 48
  1018.     Exit Sub
  1019.   End If
  1020.   'try to register VisData
  1021.   x = Shell(App.Path & "\" & App.EXEName & ".EXE /regserver")
  1022.   If Err Then
  1023.     MsgBox "You must run this from an EXE!", 48
  1024.     Exit Sub
  1025.   End If
  1026.   'only add it if the registration was successful
  1027.   x = OSWritePrivateProfileString("Add-Ins" & sOSVer, "VDAddIn.VDAddInClass", "1", "VB.INI")
  1028. End Sub
  1029. Private Sub mnuUQuery_Click()
  1030.   frmQuery.WindowState = 0
  1031. End Sub
  1032. Private Sub mnuPUCopyStruct_Click()
  1033.   On Error Resume Next
  1034.   frmCopyStruct.Show vbModal
  1035.   If Err Then ShowError
  1036. End Sub
  1037. Private Sub mnuPUDelete_Click()
  1038.   On Error GoTo TblDelErr
  1039.   Dim sName As String
  1040.   If frmTables.optTables.Value = True Then
  1041.     sName = StripConnect(frmTables.lstTables.Text)
  1042.     If MsgBox("Delete '" & sName & "' Table?", gnMSGBOX_TYPE) = gnMSGBOX_YES Then
  1043.       gdbCurrentDB.TableDefs.Delete sName
  1044.       frmTables.lstTables.RemoveItem frmTables.lstTables.ListIndex
  1045.       frmTables.lstTables.ListIndex = 0
  1046.     End If
  1047.   Else
  1048.     sName = frmTables.lstQueryDefs.Text
  1049.     If MsgBox("Delete '" & sName & "' QueryDef?", gnMSGBOX_TYPE) = gnMSGBOX_YES Then
  1050.       gdbCurrentDB.QueryDefs.Delete sName
  1051.       frmTables.lstQueryDefs.RemoveItem frmTables.lstQueryDefs.ListIndex
  1052.       frmTables.lstQueryDefs.ListIndex = 0
  1053.     End If
  1054.   End If
  1055.   Exit Sub
  1056. TblDelErr:
  1057.   ShowError
  1058.   Exit Sub
  1059. End Sub
  1060. Private Sub mnuUListCombo_Click()
  1061.   On Error Resume Next
  1062.   Dim frm As New frmListCombo
  1063.   SetHourglass
  1064.   frm.Show
  1065.   If Err Then ShowError
  1066. End Sub
  1067. Private Sub mnuPUPack_Click()
  1068.   On Error GoTo PackErr
  1069.   Dim sTmp As String
  1070.   Dim sTblName As String
  1071.   Dim i As Integer
  1072.   ReDim aIDX(0) As Index
  1073.   Dim idx As Index
  1074.   sTblName = StripConnect(frmTables.lstTables.Text)
  1075.   If MsgBox("Remove All Deleted Records in " & sTblName & "?", gnMSGBOX_TYPE) = gnMSGBOX_YES Then
  1076.     SetHourglass
  1077.     MsgBar "Packing '" & sTblName & "'", True
  1078.     sTmp = gdbCurrentDB.Name & "\"
  1079.     If Dir(sTmp & "p_a_c_k.db?") <> gsNULL_STR Then
  1080.       Kill sTmp & "p_a_c_k.db?"
  1081.     End If
  1082.     'save the indexes in an array
  1083.     For i = 0 To gdbCurrentDB.TableDefs(sTblName).Indexes.Count - 1
  1084.       Set idx = gdbCurrentDB.TableDefs(sTblName).Indexes(i)
  1085.       ReDim Preserve aIDX(i + 1)
  1086.       i = 1 + 1
  1087.       With aIDX(i)
  1088.         .Name = idx.Name
  1089.         .Fields = idx.Fields
  1090.         .Primary = idx.Primary
  1091.         .Unique = idx.Unique
  1092.       End With
  1093.     Next
  1094.     'create a new table w/o the deleted records
  1095.     gdbCurrentDB.Execute "Select * into p_a_c_k from " & sTblName
  1096.     gdbCurrentDB.TableDefs.Delete sTblName
  1097.     Name sTmp & "p_a_c_k.dbf" As sTmp & sTblName & ".dbf"
  1098.     If Dir(sTmp & "p_a_c_k.dbt") <> gsNULL_STR Then
  1099.       Name sTmp & "p_a_c_k.dbt" As sTmp & sTblName & ".dbt"
  1100.     End If
  1101.     gdbCurrentDB.TableDefs.Refresh
  1102.     'add the indexes back
  1103.     For i = 0 To UBound(aIDX) - 1
  1104.       gdbCurrentDB.TableDefs(sTblName).Indexes.Append aIDX(i)
  1105.     Next
  1106.     MsgBox "'" & sTblName & "' successfully Packed!", 48
  1107.   End If
  1108.   Screen.MousePointer = vbDefault
  1109.   MsgBar gsNULL_STR, False
  1110.   Exit Sub
  1111. PackErr:
  1112.   ShowError
  1113.   Exit Sub
  1114. End Sub
  1115. Private Sub mnuPUProperties_Click()
  1116.   If frmTables.optTables.Value = True Then
  1117.     ShowProperties "TableDef", gdbCurrentDB.TableDefs(StripConnect(frmTables.lstTables.Text))
  1118.   Else
  1119.     ShowProperties "QueryDef", gdbCurrentDB.QueryDefs(frmTables.lstQueryDefs.Text)
  1120.   End If
  1121. End Sub
  1122. Private Sub mnuPURefresh_Click()
  1123.   gdbCurrentDB.TableDefs.Refresh
  1124.   RefreshTables frmTables.lstTables, True
  1125. End Sub
  1126. Private Sub mnuPURename_Click()
  1127.   On Error GoTo PURErr
  1128.   Dim sTmp As String
  1129.   Dim oTmp As Object
  1130.   'set the name, list and object for the tables or querydefs list item
  1131.   If frmTables.optTables.Value = True Then
  1132.     sTmp = StripConnect(frmTables.lstTables.Text)
  1133.     Set oTmp = gdbCurrentDB.TableDefs(sTmp)
  1134.   Else
  1135.     sTmp = frmTables.lstQueryDefs.Text
  1136.     Set oTmp = gdbCurrentDB.QueryDefs(sTmp)
  1137.   End If
  1138. GetName:
  1139.   'get the name until they enter a new name or press cancel
  1140.   sTmp = InputBox("New Name", "Rename " & sTmp, sTmp)
  1141.   If Len(sTmp) > 0 Then
  1142.     If DupeTableName(sTmp) = False Then
  1143.       'okay name so try and rename the object
  1144.       oTmp.Name = sTmp
  1145.       'must've been successful so we need to refresh the list
  1146.       RefreshTables frmTables.lstTables, True
  1147.     Else
  1148.       'must be a dup that they don't want to delete so
  1149.       'give then another chance
  1150.       GoTo GetName
  1151.     End If
  1152.   End If
  1153.   Exit Sub
  1154. PURErr:
  1155.   ShowError
  1156.   Exit Sub
  1157. End Sub
  1158. Private Sub mnuPUZap_Click()
  1159.   On Error GoTo ZapErr
  1160.   Dim sTblName As String
  1161.   sTblName = StripConnect(frmTables.lstTables.Text)
  1162.   If MsgBox("Delete All Records in '" & sTblName & "'?", gnMSGBOX_TYPE) = gnMSGBOX_YES Then
  1163.     'delete all rows with a sql statement
  1164.     If gsDataType = gsSQLDB Then
  1165.       gdbCurrentDB.Execute ("delete from " & sTblName), dbSQLPassThrough
  1166.     Else
  1167.       gdbCurrentDB.Execute ("delete from " & sTblName)
  1168.     End If
  1169.     If gdbCurrentDB.RecordsAffected > 0 Then
  1170.       MsgBox gdbCurrentDB.RecordsAffected & " rows deleted!", 48
  1171.       If gbTransPending Then gbDBChanged = True
  1172.     End If
  1173.   End If
  1174.   Exit Sub
  1175. ZapErr:
  1176.   If Err = gnEOF_ERR Then Resume Next
  1177.   ShowError
  1178.   Exit Sub
  1179. End Sub
  1180. Private Sub mnuUCloseAll_Click()
  1181.   CloseAllRecordsets
  1182. End Sub
  1183. Private Sub mnuUClosePropForms_Click()
  1184.   CloseAllPropForms
  1185. End Sub
  1186. Private Sub mnuUCloseListComboForms_Click()
  1187.   CloseAllListCombos
  1188. End Sub
  1189. Private Sub mnuUImpExp_Click()
  1190.   On Error Resume Next
  1191.   frmImpExp.Show vbModal
  1192.   If Err Then ShowError
  1193. End Sub
  1194. Private Sub mnuUReplace_Click()
  1195.   On Error GoTo ReplaceErr
  1196.   frmReplace.Show vbModal
  1197.   Exit Sub
  1198. ReplaceErr:
  1199.   ShowError
  1200.   Exit Sub
  1201. End Sub
  1202. Private Sub mnuWArrange_Click()
  1203.   Me.Arrange 3
  1204. End Sub
  1205. Private Sub mnuWCascade_Click()
  1206.   Me.Arrange 0
  1207. End Sub
  1208. Private Sub mnuWSQL_Click()
  1209.   frmSQL.WindowState = 0
  1210. End Sub
  1211. Private Sub mnuWTableList_Click()
  1212.   frmTables.WindowState = 0
  1213.   If frmTables.lstTables.ListCount = 0 And gbDBOpenFlag = True Then
  1214.     RefreshTables frmTables.lstTables, True
  1215.   End If
  1216. End Sub
  1217. Private Sub mnuWTile_Click()
  1218.   Me.Arrange 2
  1219. End Sub
  1220. Private Sub mnuWMDI_Click()
  1221.   optDataCtl.SetFocus
  1222. End Sub
  1223. Private Sub optDataCtl_Click()
  1224.   gnFormType = gnDATACTL_FORM
  1225. End Sub
  1226. Private Sub optDataGrid_Click()
  1227.   gnFormType = gnDATAGRID_FORM
  1228. End Sub
  1229. Private Sub optDynaset_Click()
  1230.   gnRecordsetType = vbRSTypeDynaset
  1231. End Sub
  1232. Private Sub optNoDataCtl_Click()
  1233.   gnFormType = gnNODATACTL_FORM
  1234. End Sub
  1235. Private Sub optPassThru_Click()
  1236.   gnRecordsetType = gnRS_PASSTHRU
  1237. End Sub
  1238. Private Sub optSnapshot_Click()
  1239.   gnRecordsetType = vbRSTypeSnapShot
  1240. End Sub
  1241. Private Sub optTable_Click()
  1242.   gnRecordsetType = vbRSTypeTable
  1243. End Sub
  1244. Private Sub MDIForm_Load()
  1245.   On Error GoTo MDILErr
  1246.   Dim x As Integer
  1247.   gsNewLine = Chr(13) & Chr(10)
  1248.   gnMULocking = True   'pessimistic locking by default
  1249.   App.HelpFile = App.Path & "\VISDATA.HLP"
  1250.   'need to disable Btrieve menu items under 32 bit
  1251.   #If Win32 Then
  1252.      mnuDBOBtrieve.Visible = False
  1253.      mnuDBNBtrieve.Visible = False
  1254.   #Else
  1255.      mnuDBNJet30.Visible = False
  1256.      mnuDBC30MDB.Visible = False
  1257.   #End If
  1258.   'see if the user previously said no to adding system.mda
  1259.   If Len(GetINIString("LoadSystemDB", gsNULL_STR, gsVISDATA4)) = 0 Then
  1260.     '1st time so prompt to add it if it is not present
  1261.     If MsgBox("Add SYSTEM.MDA (Jet Security File) to INI File?", gnMSGBOX_TYPE) = gnMSGBOX_YES Then
  1262.       mnuJSystemDB_Click
  1263.     Else
  1264.       'store info so we don't keep asking
  1265.       SaveSetting "VisData", gsVISDATA4, "LoadSystemDB", "No"
  1266.     End If
  1267.   End If
  1268.   On Error GoTo MDILErr
  1269.   'setup the DBEngine
  1270.   #If Win32 Then
  1271.     DBEngine.IniPath = "HKEY_CURRENT_USER\Software\VB and VBA Program Settings\VisData"
  1272.   #Else
  1273.     DBEngine.IniPath = "visdata.ini"
  1274.   #End If
  1275.   DBEngine.DefaultUser = "admin"
  1276.   DBEngine.DefaultPassword = gsNULL_STR
  1277.   'login to Jet
  1278.   On Error Resume Next
  1279.   Set gwsMainWS = DBEngine.CreateWorkspace("MainWS", "admin", gsNULL_STR)
  1280.   If Err = 3029 Then
  1281.     frmLogin.Show vbModal
  1282.   ElseIf Err = 3044 Then  'invalid path so system.mda is bogus
  1283.     If MsgBox("SYSTEM.MDA Not found, Add one to INI File?", gnMSGBOX_TYPE) = gnMSGBOX_YES Then
  1284.       mnuJSystemDB_Click
  1285.     Else
  1286.       'store info so we don't keep asking
  1287.       SaveSetting "VisData", gsVISDATA4, "LoadSystemDB", "No"
  1288.       SaveSetting "VisData", "Options", "SystemDB", gsNULL_STR
  1289.     End If
  1290.   ElseIf Err <> 0 Then
  1291.     ShowError
  1292.   End If
  1293.   lblUser.Caption = " User: " & gwsMainWS.UserName & " "
  1294.   On Error GoTo MDILErr
  1295.   'add the workspace to the collection to bump the count
  1296.   Workspaces.Append gwsMainWS
  1297.   LoadINISettings
  1298.   Me.Show
  1299.   'load the child forms
  1300.   frmTables.Show
  1301.   frmSQL.Show
  1302.   'attempt to open the last database if that option
  1303.   'has been set on the preferences menu
  1304.   If frmMDI.mnuPOpenOnStartup.Checked = True Then
  1305.     If gsDataType = gsSQLDB Then
  1306.       'for an ODBC database, we need to
  1307.       'sendkeys to open the ODBC dialog
  1308.       SendKeys "%FOO{Enter}"
  1309.     Else
  1310.       OpenLocalDB True
  1311.     End If
  1312.   End If
  1313.   Exit Sub
  1314. MDILErr:
  1315.   ShowError
  1316.   End
  1317. End Sub
  1318. Private Sub MDIForm_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  1319.   On Error Resume Next
  1320.   ShutDownVisData
  1321. End Sub
  1322. Private Sub mnuDBMRU_Click(Index As Integer)
  1323.   On Error GoTo MRUErr
  1324.   gsDBName = Mid(mnuDBMRU(Index).Caption, 4, Len(mnuDBMRU(Index).Caption))
  1325.   gsDataType = mnuDBMRU(Index).Tag
  1326.   If UCase(Left(gsDataType, 5)) <> gsSQLDB Then
  1327.     OpenLocalDB True
  1328.   Else
  1329.     'must be an ODBC database so we need to load frmOpenDB
  1330.     'this will get the connect parts
  1331.     GetODBCConnectParts gsDataType
  1332.     'call the routine that will load the form
  1333.     mnuDBOODBC_Click
  1334.   End If
  1335.   Exit Sub
  1336. MRUErr:
  1337.   ShowError
  1338.   Exit Sub
  1339. End Sub
  1340.