home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / PVb5.0 / VB / SAMPLES / VISDATA / DCPROP.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1997-01-12  |  17.4 KB  |  562 lines

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