Solved

problem in IIsWebServer.start

Posted on 2001-07-18
4
175 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

707 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now