home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / remdatab / docrdbde.dob (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-08-12  |  18.3 KB  |  527 lines

  1. VERSION 5.00
  2. Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
  3. Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
  4. Object = "{59986FC1-1A8F-11D3-8054-00105A154E54}#1.1#0"; "DARDB.OCX"
  5. Begin VB.UserDocument docRDBDemo 
  6.    ClientHeight    =   6372
  7.    ClientLeft      =   0
  8.    ClientTop       =   0
  9.    ClientWidth     =   6012
  10.    HScrollSmallChange=   225
  11.    ScaleHeight     =   6372
  12.    ScaleWidth      =   6012
  13.    VScrollSmallChange=   225
  14.    Begin VB.CommandButton cmdUpdate 
  15.       Caption         =   "&Update"
  16.       Height          =   375
  17.       Left            =   2760
  18.       TabIndex        =   1
  19.       Top             =   0
  20.       Width           =   855
  21.    End
  22.    Begin DARDB.DARemDataBar DARemDataBar1 
  23.       Align           =   1  'Align Top
  24.       Height          =   372
  25.       Left            =   0
  26.       TabIndex        =   0
  27.       Top             =   0
  28.       Width           =   6012
  29.       _ExtentX        =   10605
  30.       _ExtentY        =   656
  31.       Server          =   ""
  32.       Connect         =   "Provider=Microsoft.Jet.OLEDB.3.51;Data Source=Users.mdb"
  33.       RecordSource    =   "SELECT * FROM Users"
  34.       Enabled         =   -1  'True
  35.       UpdateType      =   0
  36.       FetchMetaData   =   -1  'True
  37.    End
  38.    Begin VB.PictureBox picForm 
  39.       Appearance      =   0  'Flat
  40.       BorderStyle     =   0  'None
  41.       ForeColor       =   &H80000008&
  42.       Height          =   2412
  43.       Left            =   120
  44.       ScaleHeight     =   2412
  45.       ScaleWidth      =   6012
  46.       TabIndex        =   18
  47.       TabStop         =   0   'False
  48.       Top             =   960
  49.       Width           =   6015
  50.       Begin VB.TextBox Text1 
  51.          Appearance      =   0  'Flat
  52.          DataField       =   "FirstName"
  53.          DataSource      =   "DARemDataBar1"
  54.          Height          =   288
  55.          Left            =   3840
  56.          MaxLength       =   50
  57.          TabIndex        =   8
  58.          Top             =   0
  59.          Width           =   2052
  60.       End
  61.       Begin VB.TextBox txtLastName 
  62.          Appearance      =   0  'Flat
  63.          DataField       =   "LastName"
  64.          DataSource      =   "DARemDataBar1"
  65.          Height          =   288
  66.          Left            =   840
  67.          MaxLength       =   50
  68.          TabIndex        =   6
  69.          Top             =   0
  70.          Width           =   2052
  71.       End
  72.       Begin TabDlg.SSTab sstMain 
  73.          Height          =   1812
  74.          Left            =   0
  75.          TabIndex        =   9
  76.          Top             =   480
  77.          Width           =   5892
  78.          _ExtentX        =   10393
  79.          _ExtentY        =   3196
  80.          _Version        =   393216
  81.          Tabs            =   2
  82.          TabsPerRow      =   2
  83.          TabHeight       =   520
  84.          TabCaption(0)   =   "Contact Info"
  85.          TabPicture(0)   =   "docRDBDemo.dox":0000
  86.          Tab(0).ControlEnabled=   -1  'True
  87.          Tab(0).Control(0)=   "Label3"
  88.          Tab(0).Control(0).Enabled=   0   'False
  89.          Tab(0).Control(1)=   "Label1"
  90.          Tab(0).Control(1).Enabled=   0   'False
  91.          Tab(0).Control(2)=   "txtEmail"
  92.          Tab(0).Control(2).Enabled=   0   'False
  93.          Tab(0).Control(3)=   "txtPhone"
  94.          Tab(0).Control(3).Enabled=   0   'False
  95.          Tab(0).ControlCount=   4
  96.          TabCaption(1)   =   "Comments"
  97.          TabPicture(1)   =   "docRDBDemo.dox":001C
  98.          Tab(1).ControlEnabled=   0   'False
  99.          Tab(1).Control(0)=   "txtComments"
  100.          Tab(1).ControlCount=   1
  101.          Begin VB.TextBox txtComments 
  102.             Appearance      =   0  'Flat
  103.             DataField       =   "Comments"
  104.             DataSource      =   "DARemDataBar1"
  105.             Height          =   1212
  106.             Left            =   -74880
  107.             MaxLength       =   1000
  108.             MultiLine       =   -1  'True
  109.             ScrollBars      =   2  'Vertical
  110.             TabIndex        =   14
  111.             Top             =   480
  112.             Width           =   5652
  113.          End
  114.          Begin VB.TextBox txtPhone 
  115.             Appearance      =   0  'Flat
  116.             DataField       =   "Company"
  117.             DataSource      =   "DARemDataBar1"
  118.             Height          =   288
  119.             Left            =   1080
  120.             MaxLength       =   50
  121.             TabIndex        =   11
  122.             Top             =   600
  123.             Width           =   3492
  124.          End
  125.          Begin VB.TextBox txtEmail 
  126.             Appearance      =   0  'Flat
  127.             DataField       =   "Email"
  128.             DataSource      =   "DARemDataBar1"
  129.             Height          =   288
  130.             Left            =   1080
  131.             MaxLength       =   50
  132.             TabIndex        =   13
  133.             Top             =   1080
  134.             Width           =   3492
  135.          End
  136.          Begin VB.Label Label6 
  137.             Caption         =   "Amount Owed"
  138.             Height          =   255
  139.             Left            =   -74760
  140.             TabIndex        =   19
  141.             Top             =   600
  142.             Width           =   1215
  143.          End
  144.          Begin VB.Label Label1 
  145.             AutoSize        =   -1  'True
  146.             Caption         =   "Company"
  147.             Height          =   192
  148.             Left            =   240
  149.             TabIndex        =   10
  150.             Top             =   600
  151.             Width           =   696
  152.          End
  153.          Begin VB.Label Label3 
  154.             AutoSize        =   -1  'True
  155.             Caption         =   "E-mail"
  156.             Height          =   192
  157.             Left            =   240
  158.             TabIndex        =   12
  159.             Top             =   1080
  160.             Width           =   456
  161.          End
  162.       End
  163.       Begin VB.Label lblField 
  164.          AutoSize        =   -1  'True
  165.          BackStyle       =   0  'Transparent
  166.          Caption         =   "First Name"
  167.          Height          =   192
  168.          Index           =   1
  169.          Left            =   3000
  170.          TabIndex        =   7
  171.          Top             =   0
  172.          Width           =   780
  173.       End
  174.       Begin VB.Label lblField 
  175.          AutoSize        =   -1  'True
  176.          BackStyle       =   0  'Transparent
  177.          Caption         =   "Last Name"
  178.          Height          =   192
  179.          Index           =   0
  180.          Left            =   0
  181.          TabIndex        =   5
  182.          Top             =   0
  183.          Width           =   780
  184.       End
  185.    End
  186.    Begin VB.TextBox txtUserID 
  187.       Appearance      =   0  'Flat
  188.       DataField       =   "UserID"
  189.       DataSource      =   "DARemDataBar1"
  190.       Height          =   285
  191.       Left            =   5280
  192.       Locked          =   -1  'True
  193.       TabIndex        =   4
  194.       Top             =   600
  195.       Width           =   732
  196.    End
  197.    Begin MSDataGridLib.DataGrid DataGrid1 
  198.       Bindings        =   "docRDBDemo.dox":0038
  199.       Height          =   1692
  200.       Left            =   120
  201.       TabIndex        =   15
  202.       Top             =   3480
  203.       Width           =   5892
  204.       _ExtentX        =   10393
  205.       _ExtentY        =   2985
  206.       _Version        =   393216
  207.       HeadLines       =   1
  208.       RowHeight       =   16
  209.       FormatLocked    =   -1  'True
  210.       BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  211.          Name            =   "MS Sans Serif"
  212.          Size            =   7.8
  213.          Charset         =   0
  214.          Weight          =   400
  215.          Underline       =   0   'False
  216.          Italic          =   0   'False
  217.          Strikethrough   =   0   'False
  218.       EndProperty
  219.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  220.          Name            =   "MS Sans Serif"
  221.          Size            =   7.8
  222.          Charset         =   0
  223.          Weight          =   400
  224.          Underline       =   0   'False
  225.          Italic          =   0   'False
  226.          Strikethrough   =   0   'False
  227.       EndProperty
  228.       ColumnCount     =   6
  229.       BeginProperty Column00 
  230.          DataField       =   "UserID"
  231.          Caption         =   "UserID"
  232.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  233.             Type            =   0
  234.             Format          =   ""
  235.             HaveTrueFalseNull=   0
  236.             FirstDayOfWeek  =   0
  237.             FirstWeekOfYear =   0
  238.             LCID            =   1033
  239.             SubFormatType   =   0
  240.          EndProperty
  241.       EndProperty
  242.       BeginProperty Column01 
  243.          DataField       =   "FirstName"
  244.          Caption         =   "FirstName"
  245.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  246.             Type            =   0
  247.             Format          =   ""
  248.             HaveTrueFalseNull=   0
  249.             FirstDayOfWeek  =   0
  250.             FirstWeekOfYear =   0
  251.             LCID            =   1033
  252.             SubFormatType   =   0
  253.          EndProperty
  254.       EndProperty
  255.       BeginProperty Column02 
  256.          DataField       =   "LastName"
  257.          Caption         =   "LastName"
  258.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  259.             Type            =   0
  260.             Format          =   ""
  261.             HaveTrueFalseNull=   0
  262.             FirstDayOfWeek  =   0
  263.             FirstWeekOfYear =   0
  264.             LCID            =   1033
  265.             SubFormatType   =   0
  266.          EndProperty
  267.       EndProperty
  268.       BeginProperty Column03 
  269.          DataField       =   "Company"
  270.          Caption         =   "Company"
  271.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  272.             Type            =   0
  273.             Format          =   ""
  274.             HaveTrueFalseNull=   0
  275.             FirstDayOfWeek  =   0
  276.             FirstWeekOfYear =   0
  277.             LCID            =   1033
  278.             SubFormatType   =   0
  279.          EndProperty
  280.       EndProperty
  281.       BeginProperty Column04 
  282.          DataField       =   "Email"
  283.          Caption         =   "Email"
  284.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  285.             Type            =   0
  286.             Format          =   ""
  287.             HaveTrueFalseNull=   0
  288.             FirstDayOfWeek  =   0
  289.             FirstWeekOfYear =   0
  290.             LCID            =   1033
  291.             SubFormatType   =   0
  292.          EndProperty
  293.       EndProperty
  294.       BeginProperty Column05 
  295.          DataField       =   "Comments"
  296.          Caption         =   "Comments"
  297.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  298.             Type            =   0
  299.             Format          =   ""
  300.             HaveTrueFalseNull=   0
  301.             FirstDayOfWeek  =   0
  302.             FirstWeekOfYear =   0
  303.             LCID            =   1033
  304.             SubFormatType   =   0
  305.          EndProperty
  306.       EndProperty
  307.       SplitCount      =   1
  308.       BeginProperty Split0 
  309.          BeginProperty Column00 
  310.             ColumnWidth     =   780.095
  311.          EndProperty
  312.          BeginProperty Column01 
  313.             ColumnWidth     =   1944
  314.          EndProperty
  315.          BeginProperty Column02 
  316.             ColumnWidth     =   1944
  317.          EndProperty
  318.          BeginProperty Column03 
  319.             ColumnWidth     =   1944
  320.          EndProperty
  321.          BeginProperty Column04 
  322.             ColumnWidth     =   1944
  323.          EndProperty
  324.          BeginProperty Column05 
  325.             ColumnWidth     =   1944
  326.          EndProperty
  327.       EndProperty
  328.    End
  329.    Begin MSDataGridLib.DataGrid DataGrid2 
  330.       Height          =   852
  331.       Left            =   120
  332.       TabIndex        =   17
  333.       Top             =   5520
  334.       Width           =   5892
  335.       _ExtentX        =   10393
  336.       _ExtentY        =   1503
  337.       _Version        =   393216
  338.       HeadLines       =   1
  339.       RowHeight       =   16
  340.       FormatLocked    =   -1  'True
  341.       BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  342.          Name            =   "MS Sans Serif"
  343.          Size            =   7.8
  344.          Charset         =   0
  345.          Weight          =   400
  346.          Underline       =   0   'False
  347.          Italic          =   0   'False
  348.          Strikethrough   =   0   'False
  349.       EndProperty
  350.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  351.          Name            =   "MS Sans Serif"
  352.          Size            =   7.8
  353.          Charset         =   0
  354.          Weight          =   400
  355.          Underline       =   0   'False
  356.          Italic          =   0   'False
  357.          Strikethrough   =   0   'False
  358.       EndProperty
  359.       ColumnCount     =   6
  360.       BeginProperty Column00 
  361.          DataField       =   "UserID"
  362.          Caption         =   "UserID"
  363.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  364.             Type            =   0
  365.             Format          =   ""
  366.             HaveTrueFalseNull=   0
  367.             FirstDayOfWeek  =   0
  368.             FirstWeekOfYear =   0
  369.             LCID            =   1033
  370.             SubFormatType   =   0
  371.          EndProperty
  372.       EndProperty
  373.       BeginProperty Column01 
  374.          DataField       =   "FirstName"
  375.          Caption         =   "FirstName"
  376.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  377.             Type            =   0
  378.             Format          =   ""
  379.             HaveTrueFalseNull=   0
  380.             FirstDayOfWeek  =   0
  381.             FirstWeekOfYear =   0
  382.             LCID            =   1033
  383.             SubFormatType   =   0
  384.          EndProperty
  385.       EndProperty
  386.       BeginProperty Column02 
  387.          DataField       =   "LastName"
  388.          Caption         =   "LastName"
  389.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  390.             Type            =   0
  391.             Format          =   ""
  392.             HaveTrueFalseNull=   0
  393.             FirstDayOfWeek  =   0
  394.             FirstWeekOfYear =   0
  395.             LCID            =   1033
  396.             SubFormatType   =   0
  397.          EndProperty
  398.       EndProperty
  399.       BeginProperty Column03 
  400.          DataField       =   "Company"
  401.          Caption         =   "Company"
  402.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  403.             Type            =   0
  404.             Format          =   ""
  405.             HaveTrueFalseNull=   0
  406.             FirstDayOfWeek  =   0
  407.             FirstWeekOfYear =   0
  408.             LCID            =   1033
  409.             SubFormatType   =   0
  410.          EndProperty
  411.       EndProperty
  412.       BeginProperty Column04 
  413.          DataField       =   "Email"
  414.          Caption         =   "Email"
  415.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  416.             Type            =   0
  417.             Format          =   ""
  418.             HaveTrueFalseNull=   0
  419.             FirstDayOfWeek  =   0
  420.             FirstWeekOfYear =   0
  421.             LCID            =   1033
  422.             SubFormatType   =   0
  423.          EndProperty
  424.       EndProperty
  425.       BeginProperty Column05 
  426.          DataField       =   "Comments"
  427.          Caption         =   "Comments"
  428.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  429.             Type            =   0
  430.             Format          =   ""
  431.             HaveTrueFalseNull=   0
  432.             FirstDayOfWeek  =   0
  433.             FirstWeekOfYear =   0
  434.             LCID            =   1033
  435.             SubFormatType   =   0
  436.          EndProperty
  437.       EndProperty
  438.       SplitCount      =   1
  439.       BeginProperty Split0 
  440.          BeginProperty Column00 
  441.             ColumnWidth     =   780.095
  442.          EndProperty
  443.          BeginProperty Column01 
  444.             ColumnWidth     =   1944
  445.          EndProperty
  446.          BeginProperty Column02 
  447.             ColumnWidth     =   1944
  448.          EndProperty
  449.          BeginProperty Column03 
  450.             ColumnWidth     =   1944
  451.          EndProperty
  452.          BeginProperty Column04 
  453.             ColumnWidth     =   1944
  454.          EndProperty
  455.          BeginProperty Column05 
  456.             ColumnWidth     =   1944
  457.          EndProperty
  458.       EndProperty
  459.    End
  460.    Begin VB.Label Label2 
  461.       AutoSize        =   -1  'True
  462.       Caption         =   "Conflicting records"
  463.       ForeColor       =   &H8000000D&
  464.       Height          =   192
  465.       Left            =   120
  466.       TabIndex        =   16
  467.       Top             =   5280
  468.       Width           =   1320
  469.    End
  470.    Begin VB.Label lblField 
  471.       Alignment       =   1  'Right Justify
  472.       AutoSize        =   -1  'True
  473.       BackStyle       =   0  'Transparent
  474.       Caption         =   "User ID"
  475.       Height          =   192
  476.       Index           =   2
  477.       Left            =   4560
  478.       TabIndex        =   3
  479.       Top             =   600
  480.       Width           =   660
  481.    End
  482.    Begin VB.Label lblTitle 
  483.       AutoSize        =   -1  'True
  484.       BackStyle       =   0  'Transparent
  485.       Caption         =   "User Setup"
  486.       BeginProperty Font 
  487.          Name            =   "Arial"
  488.          Size            =   14.4
  489.          Charset         =   0
  490.          Weight          =   400
  491.          Underline       =   0   'False
  492.          Italic          =   0   'False
  493.          Strikethrough   =   0   'False
  494.       EndProperty
  495.       Height          =   324
  496.       Left            =   120
  497.       TabIndex        =   2
  498.       Top             =   480
  499.       Width           =   1452
  500.    End
  501. Attribute VB_Name = "docRDBDemo"
  502. Attribute VB_GlobalNameSpace = False
  503. Attribute VB_Creatable = True
  504. Attribute VB_PredeclaredId = False
  505. Attribute VB_Exposed = True
  506. Option Explicit
  507. Private Sub cmdUpdate_Click()
  508.     UserDocument.MousePointer = vbHourglass
  509.     DARemDataBar1.UpdateBatchConf
  510.     If DARemDataBar1.ConflictRecordset Is Nothing Then
  511.         ' If there were no conflicts, call UpdateBatch so that _
  512.           changed records do not get re-submitted (UpdateBatch causes _
  513.           UnderlyingValue to be set to Value for all records).
  514.         DARemDataBar1.Recordset.UpdateBatch
  515.         Set DataGrid2.DataSource = Nothing
  516.         DataGrid2.Refresh
  517.     Else
  518.         Set DataGrid2.DataSource = DARemDataBar1.ConflictRecordset
  519.     End If
  520.     ' Call RefreshData to fill in UserID values for new records.
  521.     DARemDataBar1.RefreshData
  522.     UserDocument.MousePointer = vbDefault
  523. End Sub
  524. Private Sub DARemDataBar1_BeforeDelete(rs As ADODB.Recordset, ByVal db As DADAO.Database, adStatus As ADODB.EventStatusEnum)
  525.     If MsgBox("Delete?", vbOKCancel) = vbCancel Then adStatus = adStatusCancel
  526. End Sub
  527.