Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

172 lines
3.4 KiB

  1. VERSION 1.0 CLASS
  2. BEGIN
  3. MultiUse = -1 'True
  4. Persistable = 0 'NotPersistable
  5. DataBindingBehavior = 0 'vbNone
  6. DataSourceBehavior = 0 'vbNone
  7. MTSTransactionMode = 0 'NotAnMTSObject
  8. END
  9. Attribute VB_Name = "Parameters"
  10. Attribute VB_GlobalNameSpace = False
  11. Attribute VB_Creatable = False
  12. Attribute VB_PredeclaredId = False
  13. Attribute VB_Exposed = True
  14. Option Explicit
  15. Public Property Get Value( _
  16. ByVal i_strName As String _
  17. ) As Variant
  18. Dim rs As ADODB.Recordset
  19. Dim strQuery As String
  20. Dim str As String
  21. str = Trim$(i_strName)
  22. Value = Null
  23. Set rs = New ADODB.Recordset
  24. strQuery = "" & _
  25. "SELECT * " & _
  26. "FROM DBParameters " & _
  27. "WHERE (Name = '" & str & "');"
  28. rs.Open strQuery, g_cnn, adOpenForwardOnly, adLockReadOnly
  29. If (Not rs.EOF) Then
  30. Value = rs("Value")
  31. End If
  32. End Property
  33. Public Property Let Value( _
  34. ByVal i_strName As String, _
  35. ByRef i_vntValue As Variant _
  36. )
  37. Dim rs As ADODB.Recordset
  38. Dim strQuery As String
  39. Dim str As String
  40. str = Trim$(i_strName)
  41. Set rs = New ADODB.Recordset
  42. strQuery = "" & _
  43. "SELECT * " & _
  44. "FROM DBParameters " & _
  45. "WHERE (Name = '" & str & "');"
  46. rs.Open strQuery, g_cnn, adOpenForwardOnly, adLockPessimistic
  47. If (rs.EOF) Then
  48. rs.AddNew
  49. rs("Name") = i_strName
  50. End If
  51. rs("Value") = i_vntValue
  52. rs.Update
  53. End Property
  54. Public Property Get AuthoringGroup() As Long
  55. On Error GoTo LErrorHandler
  56. AuthoringGroup = Value(AUTHORING_GROUP_C)
  57. Exit Property
  58. LErrorHandler:
  59. Err.Raise errAuthoringGroupNotPresent
  60. End Property
  61. Public Property Get ProductId( _
  62. ByVal i_enumSKU As Long _
  63. ) As String
  64. ProductId = Value(PRODUCT_ID_C & Hex(i_enumSKU)) & ""
  65. End Property
  66. Public Property Let ProductId( _
  67. ByVal i_enumSKU As Long, _
  68. ByVal i_strValue As String _
  69. )
  70. Value(PRODUCT_ID_C & Hex(i_enumSKU)) = i_strValue
  71. End Property
  72. Public Property Get ProductVersion( _
  73. ByVal i_enumSKU As Long _
  74. ) As String
  75. ProductVersion = Value(PRODUCT_VERSION_C & Hex(i_enumSKU)) & ""
  76. End Property
  77. Public Property Let ProductVersion( _
  78. ByVal i_enumSKU As Long, _
  79. ByVal i_strValue As String _
  80. )
  81. Value(PRODUCT_VERSION_C & Hex(i_enumSKU)) = i_strValue
  82. End Property
  83. Public Property Get DisplayName( _
  84. ByVal i_enumSKU As Long _
  85. ) As String
  86. DisplayName = Value(DISPLAY_NAME_C & Hex(i_enumSKU)) & ""
  87. End Property
  88. Public Property Let DisplayName( _
  89. ByVal i_enumSKU As Long, _
  90. ByVal i_strValue As String _
  91. )
  92. Value(DISPLAY_NAME_C & Hex(i_enumSKU)) = i_strValue
  93. End Property
  94. Public Property Get DomFragmentPackageDesc( _
  95. ByVal i_enumSKU As Long _
  96. ) As String
  97. DomFragmentPackageDesc = Value(DOM_FRAGMENT_PKG_C & Hex(i_enumSKU)) & ""
  98. End Property
  99. Public Property Let DomFragmentPackageDesc( _
  100. ByVal i_enumSKU As Long, _
  101. ByVal i_strValue As String _
  102. )
  103. Value(DOM_FRAGMENT_PKG_C & Hex(i_enumSKU)) = i_strValue
  104. End Property
  105. Public Property Get DomFragmentHHT( _
  106. ByVal i_enumSKU As Long _
  107. ) As String
  108. DomFragmentHHT = Value(DOM_FRAGMENT_HHT_C & Hex(i_enumSKU)) & ""
  109. End Property
  110. Public Property Let DomFragmentHHT( _
  111. ByVal i_enumSKU As Long, _
  112. ByVal i_strValue As String _
  113. )
  114. Value(DOM_FRAGMENT_HHT_C & Hex(i_enumSKU)) = i_strValue
  115. End Property