Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Modifying View created using Database.OpenView fai


3 replies to this topic

rpalladino

rpalladino
  • Members
  • 6 posts

Posted 09 November 2005 - 12:29

Hello. Please help!

One of my clients (with Windows 2003) has a problem running my setup.
There's a VBScript Custom Action that populates a combobox with website names. It works for all my clients, except this one.
Follows the code.


'Start to populate combo box with IIS web sites found
Set objView = Database.OpenView("select * from `ComboBox`")
objView.Execute
'enumerate webservers on localhost and populate ComboBox table
Set objW3SVC = GetObject("IIS://localhost/W3SVC")
intOrder = 1
For Each objIISWebSite In objW3SVC
If objIISWebSite.Class = "IIsWebServer" Then
'add site name to ComboBox table (which is used by our dialog ComboBox)
Set objRecord = Installer.CreateRecord(4)
objRecord.StringData(1) = "WEBSITE" 'property
objRecord.IntegerData(2) = intOrder 'order
objRecord.StringData(3) = objIISWebSite.Name 'value (WebSite number)
objRecord.StringData(4) = objIISWebSite.ServerComment 'text (WebSite Name)

If intOrder = 1 then
Session.Property("SiteName") = objIISWebSite.ServerComment
End If

'now add the record to the table
call objView.Modify(7,objRecord)
intOrder = intOrder + 1
'MsgBox(objRecord.StringData(4))
'call objRecord.ClearData()
End If
Next


The script aborts when executing the line:

call objView.Modify(7,objRecord)

and Custom Action returns error, aborting the installation.

Any ideas?

Thanks.

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 10 November 2005 - 08:37

Check the script errors.
Does he have anti-virus software running that might be blocking VBScript?

Zweitze

Zweitze
  • Full Members
  • 522 posts

Posted 10 November 2005 - 09:49

Maybe this computer has a website with an empty name? The third column in the ListBox table is not nullable.

rpalladino

rpalladino
  • Members
  • 6 posts

Posted 10 November 2005 - 14:53

Thanks for the replies.

Zweitze, your tip helped me.
The user did not hava the Default WebSite configured, and later in the code I assumed this site would always exist, then generated the error.
I corrected it and will send again.

Thanks!