Solved

problem in IIsWebServer.start

Posted on 2001-07-18
4
191 Views
Last Modified: 2007-11-27
Hi There,
Here I pasted the code to create site in IIS. In this start command is not working. Can any of you explain why it's showing error.

Dim idxItem, idxNext, objNew, objRoot, dirObj, objDir
Dim svrComment, svrPath, svrDir, templete, images, emarketing

svrComment = Text2.Text
svrPath = Text3.Text
svrPath = svrPath & "\test"
templete = svrPath & "\templete"
images = svrPath & "\images"
script = svrPath & "\scripts"
Set dirObj = CreateObject("Scripting.FileSystemObject")
dirObj.CreateFolder (svrPath)
dirObj.CreateFolder (templete)
dirObj.CreateFolder (images)
dirObj.CreateFolder (script)


Text1.Text = ""
Text1.Text = Text1.Text & "Adding a Site..." & vbCrLf
Text1.Text = Text1.Text & "Getting the Next Available Server Index..." & vbCrLf
Set objComp = GetObject("IIS://localhost/W3SVC")

For Each idxItem In objComp
If IsNumeric(idxItem.Name) Then
If idxNext < idxItem.Name Then
idxNext = idxItem.Name
End If
End If
Next
idxNext = idxNext + 1
Text1.Text = Text1.Text & " (" & idxNext & ")" & vbCrLf

Text1.Text = Text1.Text & "Creating the New Site..." & vbCrLf
Set objNew = objComp.Create("IIsWebServer", idxNext)

BindingsList = Array(0)
BindingsList(0) = ":80:"
WPort = BindingsList

objNew.ServerSize = 1
objNew.ServerComment = svrComment
objNew.ServerBindings = WPort

objNew.SetInfo

Text1.Text = Text1.Text & "Creating Site Root..." & vbCrLf
Set objRoot = objNew.Create("IIsWebVirtualDir", "Root")
objRoot.Path = svrPath
objRoot.SetInfo


Text1.Text = Text1.Text & "Setting up Server..." & vbCrLf

objRoot.AuthAnonymous = True

objRoot.AccessRead = True

objRoot.AccessWrite = True

'objRoot.AccessExecute = True

objRoot.AccessScript = True

objRoot.SetInfo

Set objDir = objRoot.Create("IIsWebDirectory", "scripts")
objDir.AccessRead = False
objDir.AccessWrite = False
objDir.AccessExecute = True
objDir.ContentIndexed = False
objDir.SetInfo
Set objDir = Nothing

Text1.Text = Text1.Text & "Starting Server..." & vbCrLf
objNew.start ' This line is showing error

Text1.Text = Text1.Text & "Server Started..." & vbCrLf
Set objNew = Nothing
0
Comment
Question by:kvraja
  • 2
4 Comments
 
LVL 22

Accepted Solution

by:
CJ_S earned 20 total points
ID: 6293800
I believe you hafta use:
Set objComp = GetObject("IIS://localhost/W3SVC/1")

Not really sure though
0
 
LVL 22

Expert Comment

by:CJ_S
ID: 6293804
and not objnew.Start but objComp.start

0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7156168
Hi kvraja,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept CJ_S's comment(s) as an answer.

kvraja, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 1

Expert Comment

by:Computer101
ID: 7182577
Comment from expert accepted as answer

Computer101
E-E Moderator
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Windows 10 start screen issues 9 55
MS Acccess - Update Field in Table when report is printed 6 47
passing parameter in sql procedure 9 65
Adding to a VBA? 6 78
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question