Windows Installer API (SDK)
_Validation Table
Referenz » _Validation Table | Microsoft Docs
VBS class Validation
Class classValidationTable
Private mTable, mColumn, mNullable, mMinValue, mMaxValue
Private mKeyTable, mKeyColumn, mCategory, mSet, mDescription
Public Property Get pTable
pTable = mTable
End Property
Public Property Let pTable(strTable)
mTable = strTable
End Property
Public Property Get pColumn
pColumn = mColumn
End Property
Public Property Let pColumn(strColumn)
mColumn = strColumn
End Property
Public Property Get pNullable
pNullable = mNullable
End Property
Public Property Let pNullable(strNullable)
mNullable = strNullable
End Property
Public Property Get pMinValue
pMinValue = mMinValue
End Property
Public Property Let pMinValue(intMinValue)
mMinValue = intMinValue
End Property
Public Property Get pMaxValue
pMaxValue = mMaxValue
End Property
Public Property Let pMaxValue(intMaxValue)
mMaxValue = intMaxValue
End Property
Public Property Get pKeyTable
pKeyTable = mKeyTable
End Property
Public Property Let pKeyTable(strKeyTable)
mKeyTable = strKeyTable
End Property
Public Property Get pKeyColumn
pKeyColumn = mKeyColumn
End Property
Public Property Let pKeyColumn(intKeyColumn)
mKeyColumn = intKeyColumn
End Property
Public Property Get pCategory
pCategory = mCategory
End Property
Public Property Let pCategory(strCategory)
mCategory = strCategory
End Property
Public Property Get pSet
pSet = mSet
End Property
Public Property Let pSet(strSet)
mSet = strSet
End Property
Public Property Get pDescription
pDescription = mDescription
End Property
Public Property Let pDescription(strDescription)
mDescription = strDescription
End Property
Private Sub Class_Initialize
'Anweisungen
End Sub
' -----------------------------------------------------------------
Public Function ModifyValidationRecord()
Dim strSQL, objView, objTableRow
strSQL = "SELECT * FROM _Validation"
Set objView = objDatabase.OpenView(strSQL)
objView.Execute
Do
Set objTableRow = objView.Fetch
If objTableRow Is Nothing Then
Set objTableRow = objInstaller.CreateRecord(10)
objTableRow.StringData(1) = mTable
objTableRow.StringData(2) = mColumn
objTableRow.StringData(3) = mNullable
If Not IsNull(mMinValue) Then objTableRow.IntegerData(4) = mMinValue
If Not IsNull(mMaxValue) Then objTableRow.IntegerData(5) = mMaxValue
objTableRow.StringData(6) = mKeyTable
If Not IsNull(mKeyColumn) Then objTableRow.IntegerData(7) = mKeyColumn
objTableRow.StringData(8) = mCategory
objTableRow.StringData(9) = mSet
objTableRow.StringData(10) = mDescription
objView.Modify msiViewModifyAssign, objTableRow
Exit Do
End If
objTableRow.StringData(1) = mTable
objTableRow.StringData(2) = mColumn
objTableRow.StringData(3) = mNullable
If Not IsNull(mMinValue) Then objTableRow.IntegerData(4) = mMinValue
If Not IsNull(mMaxValue) Then objTableRow.IntegerData(5) = mMaxValue
objTableRow.StringData(6) = mKeyTable
If Not IsNull(mKeyColumn) Then objTableRow.IntegerData(7) = mKeyColumn
objTableRow.StringData(8) = mCategory
objTableRow.StringData(9) = mSet
objTableRow.StringData(10) = mDescription
objView.Modify msiViewModifyAssign, objTableRow
Loop
objDatabase.Commit()
objView.Close
Set objView = Nothing
End Function
' -----------------------------------------------------------------
Public Function ResetValidationRecord()
mTable = ""
mColumn = ""
mNullable = ""
mMinValue = Null
mMaxValue = Null
mKeyTable = ""
mKeyColumn = Null
mCategory = ""
mSet = ""
mDescription = ""
End Function
' -----------------------------------------------------------------
Private Sub Class_Terminate()
'Anweisungen
End Sub
End Class
' ---------------------------------------------------------------------