Solved

problem in IIsWebServer.start

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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 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 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…

862 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

24 Experts available now in Live!

Get 1:1 Help Now