home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic 4 Unleashed
/
Visual_Basic_4_Unleashed_SAMS_Publishing_1995.iso
/
source
/
chap28
/
form228.frm
< prev
next >
Wrap
Text File
|
1995-09-28
|
12KB
|
450 lines
VERSION 4.00
Begin VB.Form form228
Caption = "Form2"
ClientHeight = 4785
ClientLeft = 1695
ClientTop = 1635
ClientWidth = 6375
Height = 5190
Left = 1635
LinkTopic = "Form2"
ScaleHeight = 4785
ScaleWidth = 6375
Top = 1290
Width = 6495
Begin VB.Frame Frame1
Height = 4755
Left = 0
TabIndex = 15
Top = 0
Width = 6375
Begin VB.CommandButton cmdproperties
Caption = "&Properties"
Height = 300
Left = 4380
TabIndex = 22
Top = 4320
Width = 915
End
Begin VB.ComboBox comtable
Height = 300
Left = 2880
Style = 2 'Dropdown List
TabIndex = 21
Top = 660
Width = 1875
End
Begin VB.CommandButton cmdend
Caption = "E&xit"
Height = 295
Index = 0
Left = 5460
TabIndex = 19
Top = 4320
Width = 795
End
Begin VB.ComboBox comfield
Height = 300
Left = 2880
Style = 2 'Dropdown List
TabIndex = 18
Top = 1680
Width = 1875
End
Begin VB.Label lblfield
Caption = "Field Name"
Height = 300
Left = 240
TabIndex = 17
Top = 1740
Width = 1215
End
Begin VB.Label lbltable
Caption = "Table Name"
Height = 295
Left = 240
TabIndex = 16
Top = 660
Width = 1215
End
End
Begin VB.TextBox txtvalidationtext
Height = 295
Left = 4740
TabIndex = 34
Top = 2880
Width = 1515
End
Begin VB.TextBox txtvalidaterule
Height = 295
Left = 1680
TabIndex = 32
Top = 2880
Width = 1515
End
Begin VB.TextBox txtdefaultvalue
Height = 295
Left = 1680
TabIndex = 30
Top = 2460
Width = 2355
End
Begin VB.CheckBox chkdataupdateable
Caption = "Updateable"
Height = 195
Left = 120
TabIndex = 28
Top = 3540
Width = 1875
End
Begin VB.TextBox txtcolattingorder
Height = 295
Left = 4740
TabIndex = 27
Top = 2040
Width = 1515
End
Begin VB.TextBox txtattributes
Height = 295
Left = 1680
TabIndex = 25
Top = 2040
Width = 1515
End
Begin VB.CheckBox chkallowzerolength
Caption = "Allow Zero Length"
Height = 195
Left = 3780
TabIndex = 23
Top = 3540
Width = 1875
End
Begin VB.CommandButton cmdend
Caption = "E&xit"
Height = 295
Index = 1
Left = 5440
TabIndex = 20
Top = 4320
Width = 795
End
Begin VB.TextBox txttype
Height = 295
Left = 4740
TabIndex = 7
Top = 240
Width = 1515
End
Begin VB.TextBox txtsourcetable
Height = 295
Left = 4740
TabIndex = 6
Top = 1200
Width = 1515
End
Begin VB.TextBox txtsourcefield
Height = 295
Left = 1680
TabIndex = 5
Top = 1200
Width = 1515
End
Begin VB.TextBox txtsize
Height = 295
Left = 4740
TabIndex = 4
Top = 720
Width = 1515
End
Begin VB.CheckBox chkrequired
Caption = "Required"
Height = 195
Left = 2160
TabIndex = 3
Top = 3540
Width = 1335
End
Begin VB.TextBox txtordinalposition
Height = 295
Left = 1680
TabIndex = 2
Top = 720
Width = 1515
End
Begin VB.TextBox txtname
Height = 295
Left = 1680
TabIndex = 1
Top = 240
Width = 1515
End
Begin VB.TextBox txtnotes
Height = 295
Left = 1680
TabIndex = 0
Top = 1620
Width = 4635
End
Begin VB.CheckBox chkvalidate
Caption = "Validate On set"
Height = 195
Left = 120
TabIndex = 31
Top = 3900
Width = 1875
End
Begin VB.Label lblvalidationtext
Caption = "Validation text"
Height = 295
Left = 3300
TabIndex = 35
Top = 2940
Width = 1215
End
Begin VB.Label lblvalidaterule
Caption = "Validate rule"
Height = 295
Left = 180
TabIndex = 33
Top = 2940
Width = 1215
End
Begin VB.Label lbldefault
Caption = "Default Value"
Height = 295
Left = 180
TabIndex = 29
Top = 2520
Width = 1215
End
Begin VB.Label lblcollatingorder
Caption = "Collating Order"
Height = 295
Left = 3300
TabIndex = 26
Top = 2100
Width = 1215
End
Begin VB.Label pnlattributes
Caption = "Attributes"
Height = 295
Left = 180
TabIndex = 24
Top = 2100
Width = 1215
End
Begin VB.Label lblvalue
Caption = "Source Field"
Height = 295
Left = 180
TabIndex = 14
Top = 1680
Width = 1215
End
Begin VB.Label lblsourcetable
Caption = "Source Table"
Height = 295
Left = 3300
TabIndex = 13
Top = 1200
Width = 1215
End
Begin VB.Label lblsourcefield
Caption = "Source Field"
Height = 295
Left = 180
TabIndex = 12
Top = 1200
Width = 1215
End
Begin VB.Label lblsize
Caption = "Size"
Height = 295
Left = 3300
TabIndex = 11
Top = 720
Width = 1215
End
Begin VB.Label lblposition
Caption = "Position"
Height = 295
Left = 180
TabIndex = 10
Top = 720
Width = 1215
End
Begin VB.Label lbltype
Caption = "Field type"
Height = 295
Left = 3300
TabIndex = 9
Top = 240
Width = 1215
End
Begin VB.Label lblname
Caption = "Field Name"
Height = 295
Left = 180
TabIndex = 8
Top = 240
Width = 1215
End
End
Attribute VB_Name = "form228"
Attribute VB_Creatable = False
Attribute VB_Exposed = False
Option Explicit
Dim wstitle As Workspace
Dim dbbiblio As Database
Dim rstitles As Recordset
Private Sub cmdend_Click(index As Integer)
If index = 1 Then
Frame1.Visible = True
Exit Sub
End If
Unload Me
Set form228 = Nothing
End Sub
Private Sub cmdproperties_Click()
Dim rstitles As Recordset
If Len(comfield.Text) = 0 Or Len(comtable.Text) = 0 Then
Exit Sub
End If
Frame1.Visible = False
Set rstitles = dbbiblio.OpenRecordset(comtable.Text, dbOpenTable)
If rstitles.RecordCount = 0 Then
Exit Sub
End If
rstitles.MoveFirst
If Not IsNull(rstitles(comfield.Text)) Then
txtnotes.Text = rstitles(comfield.Text).Value
End If
txttype.Text = rstitles(comfield.Text).Type
txtsourcetable.Text = rstitles(comfield.Text).SourceTable
txtsourcefield.Text = rstitles(comfield.Text).SourceField
txtsize.Text = rstitles(comfield.Text).Size
txtattributes.Text = rstitles(comfield.Text).Attributes
txtcolattingorder.Text = rstitles(comfield.Text).CollatingOrder
txtdefaultvalue.Text = rstitles(comfield.Text).DefaultValue
txtvalidaterule.Text = rstitles(comfield.Text).ValidationRule
txtvalidationtext.Text = rstitles(comfield.Text).ValidationText
If rstitles(comfield.Text).Required = True Then
chkrequired.Value = vbChecked
Else
chkrequired.Value = vbUnchecked
End If
If rstitles(comfield.Text).DataUpdatable = True Then
chkdataupdateable.Value = vbChecked
Else
chkdataupdateable.Value = vbUnchecked
End If
If rstitles(comfield.Text).AllowZeroLength = True Then
chkAllowZeroLength.Value = vbChecked
Else
chkAllowZeroLength.Value = vbUnchecked
End If
If rstitles(comfield.Text).ValidateOnSet = True Then
chkvalidate.Value = vbChecked
Else
chkvalidate.Value = vbUnchecked
End If
txtordinalposition.Text = rstitles(comfield.Text).OrdinalPosition
txtname.Text = rstitles(comfield.Text).Name
End Sub
Private Sub Command1_Click()
End Sub
Private Sub comtable_Click()
Dim X As Integer
comfield.Clear
Set rstitles = dbbiblio.OpenRecordset(comtable.Text, dbOpenTable)
For X = 1 To rstitles.Fields.Count - 1
comfield.AddItem rstitles.Fields(X).Name
Next
End Sub
Private Sub Form_Load()
Dim X As Integer
Set wstitle = DBEngine.CreateWorkspace("title", "Admin", "")
Set dbbiblio = wstitle.OpenDatabase("\source\chap28\biblio.mdb", False, False)
For X = 1 To dbbiblio.TableDefs.Count - 1
If dbbiblio.TableDefs(X).Attributes <> dbSystemObject - 2 And dbbiblio.TableDefs(X).Attributes <> dbReadOnly Then
comtable.AddItem dbbiblio.TableDefs(X).Name
End If
Next
End Sub