home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 4 Unleashed / Visual_Basic_4_Unleashed_SAMS_Publishing_1995.iso / source / chap28 / form228.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-09-28  |  11.3 KB  |  367 lines

  1. VERSION 4.00
  2. Begin VB.Form form228 
  3.    Caption         =   "Form2"
  4.    ClientHeight    =   4785
  5.    ClientLeft      =   1695
  6.    ClientTop       =   1635
  7.    ClientWidth     =   6375
  8.    Height          =   5190
  9.    Left            =   1635
  10.    LinkTopic       =   "Form2"
  11.    ScaleHeight     =   4785
  12.    ScaleWidth      =   6375
  13.    Top             =   1290
  14.    Width           =   6495
  15.    Begin VB.Frame Frame1 
  16.       Height          =   4755
  17.       Left            =   0
  18.       TabIndex        =   15
  19.       Top             =   0
  20.       Width           =   6375
  21.       Begin VB.CommandButton cmdproperties 
  22.          Caption         =   "&Properties"
  23.          Height          =   300
  24.          Left            =   4380
  25.          TabIndex        =   22
  26.          Top             =   4320
  27.          Width           =   915
  28.       End
  29.       Begin VB.ComboBox comtable 
  30.          Height          =   300
  31.          Left            =   2880
  32.          Style           =   2  'Dropdown List
  33.          TabIndex        =   21
  34.          Top             =   660
  35.          Width           =   1875
  36.       End
  37.       Begin VB.CommandButton cmdend 
  38.          Caption         =   "E&xit"
  39.          Height          =   295
  40.          Index           =   0
  41.          Left            =   5460
  42.          TabIndex        =   19
  43.          Top             =   4320
  44.          Width           =   795
  45.       End
  46.       Begin VB.ComboBox comfield 
  47.          Height          =   300
  48.          Left            =   2880
  49.          Style           =   2  'Dropdown List
  50.          TabIndex        =   18
  51.          Top             =   1680
  52.          Width           =   1875
  53.       End
  54.       Begin VB.Label lblfield 
  55.          Caption         =   "Field Name"
  56.          Height          =   300
  57.          Left            =   240
  58.          TabIndex        =   17
  59.          Top             =   1740
  60.          Width           =   1215
  61.       End
  62.       Begin VB.Label lbltable 
  63.          Caption         =   "Table Name"
  64.          Height          =   295
  65.          Left            =   240
  66.          TabIndex        =   16
  67.          Top             =   660
  68.          Width           =   1215
  69.       End
  70.    End
  71.    Begin VB.TextBox txtvalidationtext 
  72.       Height          =   295
  73.       Left            =   4740
  74.       TabIndex        =   34
  75.       Top             =   2880
  76.       Width           =   1515
  77.    End
  78.    Begin VB.TextBox txtvalidaterule 
  79.       Height          =   295
  80.       Left            =   1680
  81.       TabIndex        =   32
  82.       Top             =   2880
  83.       Width           =   1515
  84.    End
  85.    Begin VB.TextBox txtdefaultvalue 
  86.       Height          =   295
  87.       Left            =   1680
  88.       TabIndex        =   30
  89.       Top             =   2460
  90.       Width           =   2355
  91.    End
  92.    Begin VB.CheckBox chkdataupdateable 
  93.       Caption         =   "Updateable"
  94.       Height          =   195
  95.       Left            =   120
  96.       TabIndex        =   28
  97.       Top             =   3540
  98.       Width           =   1875
  99.    End
  100.    Begin VB.TextBox txtcolattingorder 
  101.       Height          =   295
  102.       Left            =   4740
  103.       TabIndex        =   27
  104.       Top             =   2040
  105.       Width           =   1515
  106.    End
  107.    Begin VB.TextBox txtattributes 
  108.       Height          =   295
  109.       Left            =   1680
  110.       TabIndex        =   25
  111.       Top             =   2040
  112.       Width           =   1515
  113.    End
  114.    Begin VB.CheckBox chkallowzerolength 
  115.       Caption         =   "Allow Zero Length"
  116.       Height          =   195
  117.       Left            =   3780
  118.       TabIndex        =   23
  119.       Top             =   3540
  120.       Width           =   1875
  121.    End
  122.    Begin VB.CommandButton cmdend 
  123.       Caption         =   "E&xit"
  124.       Height          =   295
  125.       Index           =   1
  126.       Left            =   5440
  127.       TabIndex        =   20
  128.       Top             =   4320
  129.       Width           =   795
  130.    End
  131.    Begin VB.TextBox txttype 
  132.       Height          =   295
  133.       Left            =   4740
  134.       TabIndex        =   7
  135.       Top             =   240
  136.       Width           =   1515
  137.    End
  138.    Begin VB.TextBox txtsourcetable 
  139.       Height          =   295
  140.       Left            =   4740
  141.       TabIndex        =   6
  142.       Top             =   1200
  143.       Width           =   1515
  144.    End
  145.    Begin VB.TextBox txtsourcefield 
  146.       Height          =   295
  147.       Left            =   1680
  148.       TabIndex        =   5
  149.       Top             =   1200
  150.       Width           =   1515
  151.    End
  152.    Begin VB.TextBox txtsize 
  153.       Height          =   295
  154.       Left            =   4740
  155.       TabIndex        =   4
  156.       Top             =   720
  157.       Width           =   1515
  158.    End
  159.    Begin VB.CheckBox chkrequired 
  160.       Caption         =   "Required"
  161.       Height          =   195
  162.       Left            =   2160
  163.       TabIndex        =   3
  164.       Top             =   3540
  165.       Width           =   1335
  166.    End
  167.    Begin VB.TextBox txtordinalposition 
  168.       Height          =   295
  169.       Left            =   1680
  170.       TabIndex        =   2
  171.       Top             =   720
  172.       Width           =   1515
  173.    End
  174.    Begin VB.TextBox txtname 
  175.       Height          =   295
  176.       Left            =   1680
  177.       TabIndex        =   1
  178.       Top             =   240
  179.       Width           =   1515
  180.    End
  181.    Begin VB.TextBox txtnotes 
  182.       Height          =   295
  183.       Left            =   1680
  184.       TabIndex        =   0
  185.       Top             =   1620
  186.       Width           =   4635
  187.    End
  188.    Begin VB.CheckBox chkvalidate 
  189.       Caption         =   "Validate On set"
  190.       Height          =   195
  191.       Left            =   120
  192.       TabIndex        =   31
  193.       Top             =   3900
  194.       Width           =   1875
  195.    End
  196.    Begin VB.Label lblvalidationtext 
  197.       Caption         =   "Validation text"
  198.       Height          =   295
  199.       Left            =   3300
  200.       TabIndex        =   35
  201.       Top             =   2940
  202.       Width           =   1215
  203.    End
  204.    Begin VB.Label lblvalidaterule 
  205.       Caption         =   "Validate rule"
  206.       Height          =   295
  207.       Left            =   180
  208.       TabIndex        =   33
  209.       Top             =   2940
  210.       Width           =   1215
  211.    End
  212.    Begin VB.Label lbldefault 
  213.       Caption         =   "Default Value"
  214.       Height          =   295
  215.       Left            =   180
  216.       TabIndex        =   29
  217.       Top             =   2520
  218.       Width           =   1215
  219.    End
  220.    Begin VB.Label lblcollatingorder 
  221.       Caption         =   "Collating Order"
  222.       Height          =   295
  223.       Left            =   3300
  224.       TabIndex        =   26
  225.       Top             =   2100
  226.       Width           =   1215
  227.    End
  228.    Begin VB.Label pnlattributes 
  229.       Caption         =   "Attributes"
  230.       Height          =   295
  231.       Left            =   180
  232.       TabIndex        =   24
  233.       Top             =   2100
  234.       Width           =   1215
  235.    End
  236.    Begin VB.Label lblvalue 
  237.       Caption         =   "Source Field"
  238.       Height          =   295
  239.       Left            =   180
  240.       TabIndex        =   14
  241.       Top             =   1680
  242.       Width           =   1215
  243.    End
  244.    Begin VB.Label lblsourcetable 
  245.       Caption         =   "Source Table"
  246.       Height          =   295
  247.       Left            =   3300
  248.       TabIndex        =   13
  249.       Top             =   1200
  250.       Width           =   1215
  251.    End
  252.    Begin VB.Label lblsourcefield 
  253.       Caption         =   "Source Field"
  254.       Height          =   295
  255.       Left            =   180
  256.       TabIndex        =   12
  257.       Top             =   1200
  258.       Width           =   1215
  259.    End
  260.    Begin VB.Label lblsize 
  261.       Caption         =   "Size"
  262.       Height          =   295
  263.       Left            =   3300
  264.       TabIndex        =   11
  265.       Top             =   720
  266.       Width           =   1215
  267.    End
  268.    Begin VB.Label lblposition 
  269.       Caption         =   "Position"
  270.       Height          =   295
  271.       Left            =   180
  272.       TabIndex        =   10
  273.       Top             =   720
  274.       Width           =   1215
  275.    End
  276.    Begin VB.Label lbltype 
  277.       Caption         =   "Field type"
  278.       Height          =   295
  279.       Left            =   3300
  280.       TabIndex        =   9
  281.       Top             =   240
  282.       Width           =   1215
  283.    End
  284.    Begin VB.Label lblname 
  285.       Caption         =   "Field Name"
  286.       Height          =   295
  287.       Left            =   180
  288.       TabIndex        =   8
  289.       Top             =   240
  290.       Width           =   1215
  291.    End
  292. Attribute VB_Name = "form228"
  293. Attribute VB_Creatable = False
  294. Attribute VB_Exposed = False
  295. Option Explicit
  296. Dim wstitle As Workspace
  297. Dim dbbiblio As Database
  298. Dim rstitles As Recordset
  299. Private Sub cmdend_Click(index As Integer)
  300. If index = 1 Then
  301.     Frame1.Visible = True
  302.     Exit Sub
  303. End If
  304. Unload Me
  305. Set form228 = Nothing
  306. End Sub
  307. Private Sub cmdproperties_Click()
  308. Dim rstitles As Recordset
  309. If Len(comfield.Text) = 0 Or Len(comtable.Text) = 0 Then
  310.     Exit Sub
  311. End If
  312. Frame1.Visible = False
  313. Set rstitles = dbbiblio.OpenRecordset(comtable.Text, dbOpenTable)
  314. If rstitles.RecordCount = 0 Then
  315.     Exit Sub
  316. End If
  317. rstitles.MoveFirst
  318. If Not IsNull(rstitles(comfield.Text)) Then
  319.     txtnotes.Text = rstitles(comfield.Text).Value
  320. End If
  321. txttype.Text = rstitles(comfield.Text).Type
  322. txtsourcetable.Text = rstitles(comfield.Text).SourceTable
  323. txtsourcefield.Text = rstitles(comfield.Text).SourceField
  324. txtsize.Text = rstitles(comfield.Text).Size
  325. txtattributes.Text = rstitles(comfield.Text).Attributes
  326. txtcolattingorder.Text = rstitles(comfield.Text).CollatingOrder
  327. txtdefaultvalue.Text = rstitles(comfield.Text).DefaultValue
  328. txtvalidaterule.Text = rstitles(comfield.Text).ValidationRule
  329. txtvalidationtext.Text = rstitles(comfield.Text).ValidationText
  330. If rstitles(comfield.Text).Required = True Then
  331.     chkrequired.Value = vbChecked
  332.     chkrequired.Value = vbUnchecked
  333. End If
  334. If rstitles(comfield.Text).DataUpdatable = True Then
  335.     chkdataupdateable.Value = vbChecked
  336.     chkdataupdateable.Value = vbUnchecked
  337. End If
  338. If rstitles(comfield.Text).AllowZeroLength = True Then
  339.     chkAllowZeroLength.Value = vbChecked
  340.     chkAllowZeroLength.Value = vbUnchecked
  341. End If
  342. If rstitles(comfield.Text).ValidateOnSet = True Then
  343.     chkvalidate.Value = vbChecked
  344.     chkvalidate.Value = vbUnchecked
  345. End If
  346. txtordinalposition.Text = rstitles(comfield.Text).OrdinalPosition
  347. txtname.Text = rstitles(comfield.Text).Name
  348. End Sub
  349. Private Sub Command1_Click()
  350. End Sub
  351. Private Sub comtable_Click()
  352. Dim X As Integer
  353. comfield.Clear
  354. Set rstitles = dbbiblio.OpenRecordset(comtable.Text, dbOpenTable)
  355. For X = 1 To rstitles.Fields.Count - 1
  356.     comfield.AddItem rstitles.Fields(X).Name
  357. End Sub
  358. Private Sub Form_Load()
  359. Dim X As Integer
  360. Set wstitle = DBEngine.CreateWorkspace("title", "Admin", "")
  361. Set dbbiblio = wstitle.OpenDatabase("\source\chap28\biblio.mdb", False, False)
  362. For X = 1 To dbbiblio.TableDefs.Count - 1
  363.     If dbbiblio.TableDefs(X).Attributes <> dbSystemObject - 2 And dbbiblio.TableDefs(X).Attributes <> dbReadOnly Then
  364.         comtable.AddItem dbbiblio.TableDefs(X).Name
  365.     End If
  366. End Sub
  367.