Hi,
I am trying to work out if AI can be used for my project.
I want to populate a combobox in a custom dialog from a vbs script. Can someone point me to any sample code which shows something like this?
Thanks,
Chris.
Here is a script that populate a combobox:I want to populate a combobox in a custom dialog from a vbs script. Can someone point me to any sample code which shows something like this?
Code: Select all
Set db = Session.Database
For index = 0 to 2
SQLCmd = "INSERT INTO `ComboBox` (`Property`,`Order`,`Value`,`Text`)"
SQLCmd = SQLCmd & " VALUES ('MY_PROP','" & index & "','" & index & "','"
SQLCmd = SQLCmd & "Test" & index & "') TEMPORARY"
Set view = db.OpenView( SQLCmd )
view.Execute
view.Close
NextCode: Select all
On Error Resume Next
Const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
strComputer & "\root\default:StdRegProv")
strKeyPath = "SOFTWARE\Microsoft\Microsoft SQL Server"
strValueName = "InstalledInstances"
oReg.GetMultiStringValue HKEY_LOCAL_MACHINE,strKeyPath, _
strValueName,arrValues
For Each strValue In arrValues
MsgBox strValue
Next
Code: Select all
Set db = Session.Database
On Error Resume Next
Const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
strComputer & "\root\default:StdRegProv")
strKeyPath = "SOFTWARE\Microsoft\Microsoft SQL Server"
strValueName = "InstalledInstances"
oReg.GetMultiStringValue HKEY_LOCAL_MACHINE,strKeyPath, _
strValueName,arrValues
index = 1
For Each strValue In arrValues
SQLCmd = "INSERT INTO `ComboBox` (`Property`,`Order`,`Value`,`Text`)"
SQLCmd = SQLCmd & " VALUES ('MY_PROP','" & index & "','" & strValue & "','"
SQLCmd = SQLCmd & strValue & "') TEMPORARY"
Set view = db.OpenView( SQLCmd )
view.Execute
view.Close
index = index + 1
Next
FOLLOW US
Get the latest news in Application Packaging