home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 June / Chip_2001-06_cd1.bin / zkuste / vbasic / Data / Utility / MSISDK15.msi / Logo.110 / Binary.ice08.vbs < prev    next >
Text File  |  2000-10-05  |  2KB  |  57 lines

  1. Function ICE08()
  2. On Error Resume Next
  3.  
  4.     Set recInfo=Installer.CreateRecord(1)
  5.     If Err <> 0 Then
  6.         ICE08=1
  7.         Exit Function
  8.     End If
  9.  
  10.     'Give description of test
  11.     recInfo.StringData(0)="ICE08" & Chr(9) & "3" & Chr(9) & "ICE08 - Checks for duplicate GUIDs in Component table"
  12.     Message &h03000000, recInfo
  13.  
  14.     'Give creation data
  15.     recInfo.StringData(0)="ICE08" & Chr(9) & "3" & Chr(9) & "Created 05/21/98. Last Modified 10/08/98."
  16.     Message &h03000000, recInfo
  17.  
  18.  
  19.     'Is there a Component table in the database?
  20.     iStat = Database.TablePersistent("Component")
  21.     If 1 <> iStat Then
  22.         recInfo.StringData(0)="ICE08" & Chr(9) & "3" & Chr(9) & "'Component' table missing. ICE08 cannot continue its validation." & Chr(9) & "http://dartools/Iceman/ice08.html"
  23.         Message &h03000000, recInfo
  24.         ICE08 = 1
  25.         Exit Function
  26.     End If
  27.     
  28.     'process table
  29.     Set view=Database.OpenView("SELECT `Component`,`ComponentId` FROM `Component` WHERE `ComponentId` IS NOT NULL ORDER BY `ComponentId`")
  30.     view.Execute
  31.     If Err <> 0 Then
  32.         recInfo.StringData(0)="ICE08" & Chr(9) & "0" & Chr(9) & "view.Execute API Error"
  33.         Message &h03000000, recInfo
  34.         ICE08=1
  35.         Exit Function
  36.     End If 
  37.     Do
  38.         Set rec=view.Fetch
  39.         If rec Is Nothing Then Exit Do
  40.  
  41.         'compare for duplicate        
  42.         If lastGuid=rec.StringData(2) Then
  43.         rec.StringData(0)="ICE08" & Chr(9) & "1" & Chr(9) & "Component: [1] has a duplicate GUID: [2]" & Chr(9) & "http://dartools/iceman/ice08.html" & Chr(9) & "Component" & Chr(9) & "ComponentId" & Chr(9) & "[1]"
  44.         Message &h03000000,rec
  45.         End If
  46.  
  47.         'set for next compare
  48.         lastGuid=rec.StringData(2)
  49.     Loop
  50.  
  51.     'Return iesSuccess  
  52.     ICE08 = 1
  53.     Exit Function
  54.  
  55. End Function
  56.  
  57.