home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 4 Power Pack / Visual_Basic4_Power_Pack.bin / vb4files / vbof / demostat.cls < prev    next >
Encoding:
Text File  |  1996-11-20  |  1.7 KB  |  66 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4. END
  5. Attribute VB_Name = "State"
  6. Attribute VB_Creatable = False
  7. Attribute VB_Exposed = True
  8. Option Explicit
  9.  
  10. ' the following pertain to being supported by
  11. '   VBOFCollection, VBOFObjectManager and
  12. '   VBOFEventManager
  13. Public ObjectID As Long
  14. Public ObjectChanged As Long
  15. Public ObjectAdded As Long
  16. Public ObjectDeleted As Long
  17. Public ObjectParentCount As Long
  18. Public ObjectManager As VBOFObjectManager
  19.  
  20. Public StateCode As String
  21. Public StateName As String
  22. Public CapitalCity As String
  23. Public Population As Long
  24.  
  25. Public Function ObjectInitializeFromRecordSet(Optional RecordSet As Variant) As Address
  26. ' Populate my variables from the RecordSet
  27. '   (in support of VBOFCollection)
  28.  
  29.     On Local Error Resume Next
  30.     
  31.     StateCode = RecordSet("StateCode") & ""
  32.     StateName = RecordSet("StateName") & ""
  33.     CapitalCity = RecordSet("CapitalCity") & ""
  34.     Population = RecordSet("Population") + 0
  35.     
  36.     ObjectID = RecordSet("ObjectID")
  37.  
  38.     Set ObjectInitializeFromRecordSet = Me
  39. End Function
  40.  
  41. Public Function ObjectListBoxValue() As String
  42. ' Return a String will represent this object
  43. '   in a ListBox
  44. '   (in support of VBOFCollection)
  45.  
  46.     ObjectListBoxValue = _
  47.         StateCode & " (" & StateName & ")"
  48.  
  49. End Function
  50.  
  51. Public Function ObjectNewInstanceOfMyClass() As State
  52. ' Return a new instance of this class
  53. '   (in support of VBOFCollection)
  54.  
  55.     Set ObjectNewInstanceOfMyClass = New State
  56. End Function
  57.  
  58. Public Function ObjectDataSource() As String
  59. ' Return the Data Source with which this Class is associated
  60. '   (in support of VBOFCollection)
  61.     
  62.     ObjectDataSource = "States"
  63. End Function
  64.  
  65.  
  66.