I have not problems reading or setting properties from VBS, but since the actual Items are not populated from a property I am stuck.
Any Ideas?
Posted 04 December 2001 - 00:25
I have not problems reading or setting properties from VBS, but since the actual Items are not populated from a property I am stuck.
Any Ideas?
Posted 06 December 2001 - 09:34
Public Function AppendListBox ()
Dim oDatabase
Dim oView
Dim oInstaller
Dim oRecord
Dim intCount
Dim oRecordErr
On Error Resume Next
Set oDatabase = Session.Database
Set oView = oDatabase.OpenView("SELECT * FROM ListBox")
If oView Is Nothing Then
Set oDatabase = Nothing
Exit Function
End If
Set oInstaller = Session.Installer
'Each record will have four columns. First is the property, second an id
'third to the value and the fourth to the key
Set oRecord = oInstaller.CreateRecord(4)
If Not oRecord Is Nothing Then
'Set the property of the control to which the records are to be attached
oRecord.StringData(1) = "ACTIVESERVERS"
oRecord.IntegerData(2) = id '(integer)
oRecord.StringData(3) = "value"
oRecord.StringData(4) = "key"
End If
On Error Resume Next
'Read/Write on to the view
oView.Modify 7,oRecord
Set oRecord = Nothing
Set oRecordErr = oInstaller.LastErrorRecord
If Not oRecordErr Is Nothing Then
For intCount = 0 to oRecordErr.FieldCount
ShowError oRecordErr.StringData & " " & oRecordErr.IntegerData
Set oRecordErr = Nothing
Exit Function
Next
End If
oView.Close
Set oView = Nothing
Set oDatabase = Nothing
Set oInstaller = Nothing
Set oRecord = Nothing
Set oRecordErr = Nothing
End Function
Posted 06 December 2001 - 20:49
I came pretty close yesterday, but instead of using CreateRecord - I tried to fetch one and modify it but then Modify threw an error - probably because of primary key overlaps.
BTW. InstallShield support has notfied me that populating ComboBoxes and Listboxes dynamically is impossible. I am glad you added the last missing piece in my puzzle.
Many Thanks!