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

  1. VERSION 4.00
  2. Begin VB.Form frmDataCtlProp 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "Data Control Properties"
  5.    ClientHeight    =   5280
  6.    ClientLeft      =   1740
  7.    ClientTop       =   1695
  8.    ClientWidth     =   5910
  9.    Height          =   5685
  10.    HelpContextID   =   2016124
  11.    Icon            =   "DCPROP.frx":0000
  12.    Left            =   1680
  13.    LinkTopic       =   "Form1"
  14.    LockControls    =   -1  'True
  15.    MaxButton       =   0   'False
  16.    MinButton       =   0   'False
  17.    ScaleHeight     =   5280
  18.    ScaleWidth      =   5910
  19.    Top             =   1350
  20.    Width           =   6030
  21.    Begin VB.PictureBox picCtlType 
  22.       Appearance      =   0  'Flat
  23.       BorderStyle     =   0  'None
  24.       ForeColor       =   &H80000008&
  25.       Height          =   255
  26.       Left            =   2760
  27.       ScaleHeight     =   255
  28.       ScaleWidth      =   2775
  29.       TabIndex        =   38
  30.       Top             =   4440
  31.       Width           =   2775
  32.       Begin VB.OptionButton optOLECtl 
  33.          Caption         =   "OLE"
  34.          Height          =   255
  35.          Left            =   0
  36.          TabIndex        =   40
  37.          Top             =   0
  38.          Width           =   735
  39.       End
  40.       Begin VB.OptionButton optPictureCtl 
  41.          Caption         =   "PictureBox"
  42.          Height          =   255
  43.          Left            =   1080
  44.          TabIndex        =   39
  45.          Top             =   0
  46.          Width           =   1215
  47.       End
  48.    End
  49.    Begin VB.CheckBox chkForwardOnly 
  50.       Caption         =   "ForwardOnly"
  51.       Height          =   255
  52.       Left            =   2040
  53.       TabIndex        =   16
  54.       Top             =   3000
  55.       Width           =   1215
  56.    End
  57.    Begin VB.CheckBox chkFailOnError 
  58.       Caption         =   "FailOnError"
  59.       Height          =   255
  60.       Left            =   840
  61.       TabIndex        =   15
  62.       Top             =   3000
  63.       Width           =   1215
  64.    End
  65.    Begin VB.CheckBox chkSQLPassthrough 
  66.       Caption         =   "SQLPassthru"
  67.       Height          =   255
  68.       Left            =   3240
  69.       TabIndex        =   14
  70.       Top             =   2760
  71.       Width           =   1335
  72.    End
  73.    Begin VB.CheckBox chkConsistent 
  74.       Caption         =   "Consistent"
  75.       Height          =   255
  76.       Left            =   2040
  77.       TabIndex        =   13
  78.       Top             =   2760
  79.       Width           =   1095
  80.    End
  81.    Begin VB.CheckBox chkInconsistent 
  82.       Caption         =   "Inconsistent"
  83.       Height          =   255
  84.       Left            =   840
  85.       TabIndex        =   12
  86.       Top             =   2760
  87.       Width           =   1215
  88.    End
  89.    Begin VB.CheckBox chkAppendOnly 
  90.       Caption         =   "AppendOnly"
  91.       Height          =   255
  92.       Left            =   4440
  93.       TabIndex        =   11
  94.       Top             =   2520
  95.       Width           =   1215
  96.    End
  97.    Begin VB.CheckBox chkReadOnly 
  98.       Caption         =   "ReadOnly"
  99.       Height          =   255
  100.       Left            =   3240
  101.       TabIndex        =   10
  102.       Top             =   2520
  103.       Width           =   1095
  104.    End
  105.    Begin VB.CheckBox chkDenyRead 
  106.       Caption         =   "DenyRead"
  107.       Height          =   255
  108.       Left            =   2040
  109.       TabIndex        =   9
  110.       Top             =   2520
  111.       Width           =   1095
  112.    End
  113.    Begin VB.CheckBox chkDenyWrite 
  114.       Caption         =   "DenyWrite"
  115.       Height          =   255
  116.       Left            =   840
  117.       TabIndex        =   8
  118.       Top             =   2520
  119.       Width           =   1095
  120.    End
  121.    Begin VB.CheckBox chkDBReadOnly 
  122.       Caption         =   "ReadOnly"
  123.       Height          =   255
  124.       Left            =   3000
  125.       TabIndex        =   3
  126.       Top             =   1080
  127.       Width           =   1215
  128.    End
  129.    Begin VB.CheckBox chkExclusive 
  130.       Caption         =   "Exclusive"
  131.       Height          =   255
  132.       Left            =   1080
  133.       TabIndex        =   2
  134.       Top             =   1080
  135.       Width           =   1335
  136.    End
  137.    Begin VB.CommandButton cmdCancel 
  138.       Cancel          =   -1  'True
  139.       Caption         =   "&Cancel"
  140.       Height          =   375
  141.       Left            =   3120
  142.       TabIndex        =   23
  143.       Top             =   4800
  144.       Width           =   2295
  145.    End
  146.    Begin VB.CommandButton cmdRefresh 
  147.       Caption         =   "&Refresh Data Control"
  148.       Height          =   375
  149.       Left            =   360
  150.       TabIndex        =   22
  151.       Top             =   4800
  152.       Width           =   2295
  153.    End
  154.    Begin VB.TextBox txtRecordSource 
  155.       Height          =   285
  156.       Left            =   1320
  157.       TabIndex        =   4
  158.       Top             =   1800
  159.       Width           =   4455
  160.    End
  161.    Begin VB.TextBox txtConnect 
  162.       Height          =   285
  163.       Left            =   840
  164.       TabIndex        =   1
  165.       Top             =   720
  166.       Width           =   4935
  167.    End
  168.    Begin VB.TextBox txtDatabaseName 
  169.       Height          =   285
  170.       Left            =   840
  171.       TabIndex        =   0
  172.       Top             =   360
  173.       Width           =   4935
  174.    End
  175.    Begin VB.PictureBox picRSType 
  176.       Appearance      =   0  'Flat
  177.       BorderStyle     =   0  'None
  178.       ForeColor       =   &H80000008&
  179.       Height          =   285
  180.       Left            =   1680
  181.       ScaleHeight     =   285
  182.       ScaleWidth      =   4095
  183.       TabIndex        =   29
  184.       TabStop         =   0   'False
  185.       Top             =   2160
  186.       Width           =   4095
  187.       Begin VB.OptionButton optRSType 
  188.          Caption         =   "1 - Dynaset"
  189.          Height          =   255
  190.          Index           =   1
  191.          Left            =   1200
  192.          TabIndex        =   6
  193.          Top             =   5
  194.          Width           =   1335
  195.       End
  196.       Begin VB.OptionButton optRSType 
  197.          Caption         =   "0 - Table"
  198.          Height          =   255
  199.          Index           =   0
  200.          Left            =   20
  201.          TabIndex        =   5
  202.          Top             =   5
  203.          Width           =   1215
  204.       End
  205.       Begin VB.OptionButton optRSType 
  206.          Caption         =   "2 - Snapshot"
  207.          Height          =   255
  208.          Index           =   2
  209.          Left            =   2640
  210.          TabIndex        =   7
  211.          Top             =   5
  212.          Width           =   1455
  213.       End
  214.    End
  215.    Begin VB.PictureBox picEOFAction 
  216.       Appearance      =   0  'Flat
  217.       BorderStyle     =   0  'None
  218.       ForeColor       =   &H80000008&
  219.       Height          =   255
  220.       Left            =   1320
  221.       ScaleHeight     =   255
  222.       ScaleWidth      =   3855
  223.       TabIndex        =   27
  224.       TabStop         =   0   'False
  225.       Top             =   4080
  226.       Width           =   3855
  227.       Begin VB.OptionButton optEOFAction 
  228.          Caption         =   "2 - AddNew"
  229.          Height          =   255
  230.          Index           =   2
  231.          Left            =   2520
  232.          TabIndex        =   21
  233.          Top             =   0
  234.          Width           =   1215
  235.       End
  236.       Begin VB.OptionButton optEOFAction 
  237.          Caption         =   "0 - MoveLast"
  238.          Height          =   255
  239.          Index           =   0
  240.          Left            =   0
  241.          TabIndex        =   19
  242.          Top             =   0
  243.          Width           =   1335
  244.       End
  245.       Begin VB.OptionButton optEOFAction 
  246.          Caption         =   "1 - EOF"
  247.          Height          =   255
  248.          Index           =   1
  249.          Left            =   1440
  250.          TabIndex        =   20
  251.          Top             =   0
  252.          Width           =   975
  253.       End
  254.    End
  255.    Begin VB.PictureBox picBOFAction 
  256.       Appearance      =   0  'Flat
  257.       BorderStyle     =   0  'None
  258.       ForeColor       =   &H80000008&
  259.       Height          =   255
  260.       Left            =   1320
  261.       ScaleHeight     =   255
  262.       ScaleWidth      =   2535
  263.       TabIndex        =   25
  264.       TabStop         =   0   'False
  265.       Top             =   3720
  266.       Width           =   2535
  267.       Begin VB.OptionButton optBOFAction 
  268.          Caption         =   "1 - BOF"
  269.          Height          =   255
  270.          Index           =   1
  271.          Left            =   1440
  272.          TabIndex        =   18
  273.          Top             =   0
  274.          Width           =   975
  275.       End
  276.       Begin VB.OptionButton optBOFAction 
  277.          Caption         =   "0 - MoveFirst"
  278.          Height          =   255
  279.          Index           =   0
  280.          Left            =   0
  281.          TabIndex        =   17
  282.          Top             =   0
  283.          Width           =   1335
  284.       End
  285.    End
  286.    Begin VB.Label lblLabels 
  287.       Caption         =   "Bound Binary Control Type: "
  288.       Height          =   195
  289.       Index           =   9
  290.       Left            =   120
  291.       TabIndex        =   37
  292.       Top             =   4440
  293.       Width           =   2535
  294.    End
  295.    Begin VB.Label lblLabels 
  296.       Alignment       =   2  'Center
  297.       Caption         =   "Data Control Properties"
  298.       Height          =   195
  299.       Index           =   8
  300.       Left            =   120
  301.       TabIndex        =   36
  302.       Top             =   3480
  303.       Width           =   5655
  304.    End
  305.    Begin VB.Line Line1 
  306.       BorderWidth     =   3
  307.       Index           =   1
  308.       X1              =   120
  309.       X2              =   5760
  310.       Y1              =   3360
  311.       Y2              =   3360
  312.    End
  313.    Begin VB.Line Line1 
  314.       BorderWidth     =   3
  315.       Index           =   0
  316.       X1              =   120
  317.       X2              =   5760
  318.       Y1              =   1440
  319.       Y2              =   1440
  320.    End
  321.    Begin VB.Label lblLabels 
  322.       Alignment       =   2  'Center
  323.       Caption         =   "Recordset Properties"
  324.       Height          =   195
  325.       Index           =   10
  326.       Left            =   120
  327.       TabIndex        =   35
  328.       Top             =   1560
  329.       Width           =   5655
  330.    End
  331.    Begin VB.Label lblLabels 
  332.       Alignment       =   2  'Center
  333.       Caption         =   "Database Properties"
  334.       Height          =   195
  335.       Index           =   7
  336.       Left            =   120
  337.       TabIndex        =   34
  338.       Top             =   45
  339.       Width           =   5655
  340.    End
  341.    Begin VB.Label lblLabels 
  342.       AutoSize        =   -1  'True
  343.       Caption         =   "Options: "
  344.       Height          =   195
  345.       Index           =   6
  346.       Left            =   120
  347.       TabIndex        =   33
  348.       Top             =   2520
  349.       Width           =   630
  350.    End
  351.    Begin VB.Label lblLabels 
  352.       AutoSize        =   -1  'True
  353.       Caption         =   "RecordSource: "
  354.       Height          =   195
  355.       Index           =   5
  356.       Left            =   120
  357.       TabIndex        =   32
  358.       Top             =   1800
  359.       Width           =   1125
  360.    End
  361.    Begin VB.Label lblLabels 
  362.       AutoSize        =   -1  'True
  363.       Caption         =   "Connect: "
  364.       Height          =   195
  365.       Index           =   4
  366.       Left            =   120
  367.       TabIndex        =   31
  368.       Top             =   720
  369.       Width           =   690
  370.    End
  371.    Begin VB.Label lblLabels 
  372.       AutoSize        =   -1  'True
  373.       Caption         =   "Name: "
  374.       Height          =   195
  375.       Index           =   3
  376.       Left            =   120
  377.       TabIndex        =   30
  378.       Top             =   360
  379.       Width           =   510
  380.    End
  381.    Begin VB.Label lblLabels 
  382.       AutoSize        =   -1  'True
  383.       Caption         =   "RecordsetType: "
  384.       Height          =   195
  385.       Index           =   2
  386.       Left            =   120
  387.       TabIndex        =   28
  388.       Top             =   2160
  389.       Width           =   1185
  390.    End
  391.    Begin VB.Label lblLabels 
  392.       Caption         =   "EOFAction: "
  393.       Height          =   195
  394.       Index           =   1
  395.       Left            =   120
  396.       TabIndex        =   26
  397.       Top             =   4080
  398.       Width           =   1215
  399.    End
  400.    Begin VB.Label lblLabels 
  401.       Caption         =   "BOFAction: "
  402.       Height          =   195
  403.       Index           =   0
  404.       Left            =   120
  405.       TabIndex        =   24
  406.       Top             =   3720
  407.       Width           =   1095
  408.    End
  409. Attribute VB_Name = "frmDataCtlProp"
  410. Attribute VB_Creatable = False
  411. Attribute VB_Exposed = False
  412. Option Explicit
  413. Sub cmdCancel_Click()
  414.   Set gDataCtlObj = Nothing
  415.   Unload Me
  416. End Sub
  417. Sub cmdRefresh_Click()
  418.   On Error GoTo RefErr
  419.   gbSettingDataCtl = True
  420.   gDataCtlObj.DatabaseName = txtDatabaseName.Text
  421.   gDataCtlObj.Connect = txtConnect.Text
  422.   gDataCtlObj.Exclusive = IIf(chkExclusive.Value = 0, 0, -1)
  423.   gDataCtlObj.ReadOnly = IIf(chkDBReadOnly.Value = 0, 0, -1)
  424.   gDataCtlObj.RecordSource = txtRecordSource.Text
  425.   If optRSType(0).Value = True Then
  426.     gDataCtlObj.RecordsetType = 0
  427.   ElseIf optRSType(1).Value = True Then
  428.     gDataCtlObj.RecordsetType = 1
  429.   Else
  430.     gDataCtlObj.RecordsetType = 2
  431.   End If
  432.   gDataCtlObj.Options = 0
  433.   'set the selected options
  434.   If chkDenyWrite.Value = 1 Then
  435.     gDataCtlObj.Options = gDataCtlObj.Options Or dbDenyWrite
  436.   End If
  437.   If chkDenyRead.Value = 1 Then
  438.     gDataCtlObj.Options = gDataCtlObj.Options Or dbDenyRead
  439.   End If
  440.   If chkReadOnly.Value = 1 Then
  441.     gDataCtlObj.Options = gDataCtlObj.Options Or dbReadOnly
  442.   End If
  443.   If chkAppendOnly.Value = 1 Then
  444.     gDataCtlObj.Options = gDataCtlObj.Options Or dbAppendOnly
  445.   End If
  446.   If chkInconsistent.Value = 1 Then
  447.     gDataCtlObj.Options = gDataCtlObj.Options Or dbInconsistent
  448.   End If
  449.   If chkConsistent.Value = 1 Then
  450.     gDataCtlObj.Options = gDataCtlObj.Options Or dbConsistent
  451.   End If
  452.   If chkSQLPassthrough.Value = 1 Then
  453.     gDataCtlObj.Options = gDataCtlObj.Options Or dbSQLPassThrough
  454.   End If
  455.   If chkFailOnError.Value = 1 Then
  456.     gDataCtlObj.Options = gDataCtlObj.Options Or dbFailOnError
  457.   End If
  458.   If chkForwardOnly.Value = 1 Then
  459.     gDataCtlObj.Options = gDataCtlObj.Options Or dbForwardOnly
  460.   End If
  461.   If optBOFAction(0).Value = True Then
  462.     gDataCtlObj.BOFAction = 0
  463.   Else
  464.     gDataCtlObj.BOFAction = 1
  465.   End If
  466.   If optEOFAction(0).Value = True Then
  467.     gDataCtlObj.EOFAction = 0
  468.   ElseIf optEOFAction(1).Value = True Then
  469.     gDataCtlObj.EOFAction = 1
  470.   Else
  471.     gDataCtlObj.EOFAction = 2
  472.   End If
  473.   gDataCtlObj.Tag = IIf(optOLECtl.Value = True, "OLE", "PIC")
  474.   Unload Me
  475.   Exit Sub
  476. RefErr:
  477.   gbSettingDataCtl = False
  478.   ShowError
  479.   Exit Sub
  480. End Sub
  481. Sub Form_Load()
  482.   CenterMe Me, gnMDIFORM
  483.   txtDatabaseName.Text = gDataCtlObj.DatabaseName
  484.   txtConnect.Text = gDataCtlObj.Connect
  485.   chkExclusive.Value = IIf(gDataCtlObj.Exclusive, 1, 0)
  486.   chkDBReadOnly.Value = IIf(gDataCtlObj.ReadOnly, 1, 0)
  487.   txtRecordSource.Text = gDataCtlObj.RecordSource
  488.   optRSType(gDataCtlObj.RecordsetType).Value = True
  489.   If (gDataCtlObj.Options And dbDenyWrite) = dbDenyWrite Then
  490.     chkDenyWrite.Value = 1
  491.   End If
  492.   If (gDataCtlObj.Options And dbDenyRead) = dbDenyRead Then
  493.     chkDenyRead.Value = 1
  494.   End If
  495.   If (gDataCtlObj.Options And dbReadOnly) = dbReadOnly Then
  496.     chkReadOnly.Value = 1
  497.   End If
  498.   If (gDataCtlObj.Options And dbAppendOnly) = dbAppendOnly Then
  499.     chkAppendOnly.Value = 1
  500.   End If
  501.   If (gDataCtlObj.Options And dbInconsistent) = dbInconsistent Then
  502.     chkInconsistent.Value = 1
  503.   End If
  504.   If (gDataCtlObj.Options And dbConsistent) = dbConsistent Then
  505.     chkConsistent.Value = 1
  506.   End If
  507.   If (gDataCtlObj.Options And dbSQLPassThrough) = dbSQLPassThrough Then
  508.     chkSQLPassthrough.Value = 1
  509.   End If
  510.   If (gDataCtlObj.Options And dbFailOnError) = dbFailOnError Then
  511.     chkFailOnError.Value = 1
  512.   End If
  513.   If (gDataCtlObj.Options And dbForwardOnly) = dbForwardOnly Then
  514.     chkForwardOnly.Value = 1
  515.   End If
  516.   optBOFAction(gDataCtlObj.BOFAction).Value = True
  517.   optEOFAction(gDataCtlObj.EOFAction).Value = True
  518.   optOLECtl.Value = IIf(gDataCtlObj.Tag = "OLE", True, False)
  519.   Screen.MousePointer = vbDefault
  520. End Sub
  521.