home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / software / pelne / optionp / iis4_07.cab / Interest.cls < prev    next >
Text File  |  1997-11-01  |  2KB  |  80 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4. END
  5. Attribute VB_Name = "Interest"
  6. Attribute VB_GlobalNameSpace = False
  7. Attribute VB_Creatable = True
  8. Attribute VB_PredeclaredId = False
  9. Attribute VB_Exposed = True
  10. Function AddNew(ByVal strFileDSN As String, ByVal intCategoryID As Integer, ByVal strDescription As String)
  11.  
  12.     On Error GoTo ErrorHandler
  13.     
  14.     ' NYI
  15.     
  16.     Exit Function
  17.  
  18. ErrorHandler:
  19.     
  20. End Function
  21.  
  22. Function Update(ByVal strFileDSN As String, ByVal intInterestID As Integer, ByVal intCategoryID As Integer, ByVal strDescription As String)
  23.  
  24.     On Error GoTo ErrorHandler
  25.     
  26.     ' NYI
  27.     
  28.     Exit Function
  29.  
  30. ErrorHandler:
  31.  
  32. End Function
  33.  
  34. Function Remove(ByVal strFileDSN As String, ByVal intInterestID As Integer)
  35.  
  36.     On Error GoTo ErrorHandler
  37.     
  38.     ' NYI
  39.  
  40.     Exit Function
  41.  
  42. ErrorHandler:
  43.  
  44. End Function
  45.  
  46. Function ListAll(ByVal strFileDSN As String)
  47.  
  48.     Dim objContext As ObjectContext
  49.     Set objContext = GetObjectContext
  50.     
  51.     On Error GoTo ErrorHandler
  52.     
  53.     Dim strSQL As String
  54.     Dim rst As New ADODB.Recordset
  55.  
  56.     strSQL = "SELECT Interests.InterestID, " & _
  57.                 "Interests.InterestDescription, " & _
  58.                 "InterestCategories.Description " & _
  59.              "FROM InterestCategories INNER JOIN Interests " & _
  60.              "ON InterestCategories.CategoryID = Interests.CategoryID " & _
  61.              "ORDER BY InterestCategories.SortOrder, Interests.InterestDescription"
  62.  
  63.     rst.CursorLocation = adUseServer
  64.     rst.Open strSQL, "FILEDSN=" & strFileDSN, adOpenStatic, adLockReadOnly, adCmdText
  65.     
  66.     objContext.SetComplete
  67.     
  68.     Set ListAll = rst
  69.     
  70.     Exit Function
  71.     
  72. ErrorHandler:
  73.     If Not rst Is Nothing Then Set rst = Nothing
  74.         
  75.     objContext.SetAbort
  76.     Err.Raise Err.Number, "Interest.ListAll()", Err.Description
  77.  
  78. End Function
  79.  
  80.