Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

problem in IIsWebServer.start

Posted on 2001-07-18
4
Medium Priority
?
225 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 80 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

877 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