home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Software Sampler / Visual_Basic_Software_Sampler_Visual_Basic_Programmers_Journal_June_1996.iso / issues / 04apr96 / code / pcp100.txt < prev    next >
Text File  |  1996-04-24  |  1KB  |  46 lines

  1. Listing 1
  2.  
  3. Private Sub Form_Load()
  4.     
  5.     Dim SampleEmployee As New Employee
  6.     Dim SampleCustomer As New Customer
  7.     Dim SampleProduct As New Product
  8.     
  9.     Set Database = _
  10.         OpenDatabase(App.Path & _
  11.         "\MyDB.MDB")
  12.     
  13. ' retrieve the appropriate rows from the
  14. ' Employee Table and instantiate 
  15. ' Employee objects
  16.     SmallBusiness.Employees._
  17.         InstantiateFromDatabase _
  18.         Parent:=SmallBusiness, _
  19.         SampleObject:=SampleEmployee, _
  20.         Database:=Database
  21.         
  22. ' set the datEmployees.RecordSet to the
  23. ' RecordSet created within the 
  24. ' DataAwareCollection
  25.     Set datEmployees.RecordSet = _
  26.         SmallBusiness.Employees.RecordSet
  27.  
  28.     SmallBusiness.Customers._
  29.         InstantiateFromDatabase _
  30.         Parent:=SmallBusiness, _
  31.         SampleObject:=SampleCustomer, _
  32.         Database:=Database
  33.     Set datCustomers.RecordSet = _
  34.         SmallBusiness.Customers.RecordSet
  35.         
  36.     SmallBusiness.Products._
  37.         InstantiateFromDatabase _
  38.         Parent:=SmallBusiness, _
  39.         SampleObject:=SampleProduct, _
  40.         Database:=Database
  41.     Set datProducts.RecordSet = _
  42.         SmallBusiness.Products.RecordSet
  43.         
  44. End Sub
  45.  
  46.