Code Bank
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingCode Bank

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old July 22nd, 2004, 06:02 AM
krudi01 krudi01 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 1 krudi01 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Exclamation FileSystemObject

I created a page that references the FileSystemObject. It works fine if called straight from a folder, but as soon as I call it from a virtual folder I get an error telling me the "ActiveX component cannot create object: 'Scripting:FileSystemObject'". I have applied the latest Microsoft Scripting, but the error persists, is there anybody that can help me with this?

The Code looks like this:

<HTML>
<HEAD>
<script type="text/vbscript">
' This program looks for a directory structure such as "C:\Telkom\ABSA\Daily\zajbes01\zajbes01 2004-07-21 00-00 144 600 FullDaily"
Dim Path
Path = "C:\Telkom\"

Function FirstLoad
ShowCustomer
ShowPeriod
ShowServer
End Function

Function ShowCustomer
Dim fso, f, f1, s, sf
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder(Path)
Set sf = f.SubFolders
I = 0
document.frm.customer.length = I
for each f1 in sf
I = I + 1
s = f1.name
Set oOption = document.createElement("OPTION")
document.frm.customer.add(oOption)
oOption.text = s
oOption.value = s
next
document.frm.customer.length = I
ShowPeriod
ShowServer
End Function

Function ShowPeriod
Dim fso, f, f1, s, sf
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder(Path & document.frm.customer.value)
Set sf = f.SubFolders
I = 0
document.frm.period.length = I
for each f1 in sf
I = I + 1
s = f1.name
Set oOption = document.createElement("OPTION")
document.frm.period.add(oOption)
oOption.text = s
oOption.value = s
next
document.frm.period.length = I
if I = 0 then
document.frm.NewRepButton.disabled = true
document.frm.server.disabled = true
document.frm.period.disabled = true
else
document.frm.NewRepButton.disabled = false
document.frm.server.disabled = false
document.frm.period.disabled = false
end if
ShowServer
End Function

Function ShowServer
Dim fso, f, f1, s, sf
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder(Path & document.frm.customer.value & "\" & document.frm.period.value)
Set sf = f.SubFolders
I = 0
document.frm.server.length = I
for each f1 in sf
I = I + 1
s = f1.name
Set oOption = document.createElement("OPTION")
document.frm.server.add(oOption)
oOption.text = s
oOption.value = s
next
document.frm.server.length = I
if I = 0 then
document.frm.NewRepButton.disabled = true
document.frm.server.disabled = true
else
document.frm.NewRepButton.disabled = false
document.frm.server.disabled = false
end if
End Function

Function NewRep
Dim repName
if len(document.frm.Calendar1.Month) = 1 then
CM = "0" & document.frm.Calendar1.Month
else
CM = document.frm.Calendar1.Month
end if
if lcase(document.frm.period.value) <> "daily" then
repName = Path & document.frm.customer.value & "\" & document.frm.period.value & "\" & document.frm.server.value & "\" & document.frm.server.value & " " & document.frm.Calendar1.Year & "-" & CM & "-" & document.frm.Calendar1.Day & " 00-00 24 3600 MonthTrend\Index.html"
else
repName = Path & document.frm.customer.value & "\" & document.frm.period.value & "\" & document.frm.server.value & "\" & document.frm.server.value & " " & document.frm.Calendar1.Year & "-" & CM & "-" & document.frm.Calendar1.Day & " 00-00 144 600 FullDaily\Index.html"
end if
msgbox repName
'Set oWin = Window.Open(repName)
End Function
</script>
<TITLE>Report Selector</TITLE>
</HEAD>
<BODY onload="FirstLoad">
<form name="frm">
<table width="100%">
<tr>
<td><FONT face=Tahoma>Customer:</FONT></td>
<td><select name="customer" onfocus="ShowPeriod" onchange="ShowPeriod"></select><input type="button" value="Change" onclick="ShowPeriod" id=button1 name=button1></td>
</tr>
<tr>
<td><FONT face=Tahoma>Period:</FONT></td>
<td><select name="period" onfocus="ShowServer" onchange="ShowServer"></select><input type="button" value="Change" onclick="ShowServer" id=button2 name=button2></td>
</tr>
<tr>
<td><FONT face=Tahoma>Server:</FONT></td>
<td><select name="server"></select></td>
</tr>
<tr>
<td></td>
<td>
<OBJECT id=Calendar1 style="LEFT: 0px; TOP: 0px"
classid=clsid:8E27C92B-1264-101C-8A2F-040224009C02><PARAM NAME="_Version" VALUE="524288"><PARAM NAME="_ExtentX" VALUE="7620"><PARAM NAME="_ExtentY" VALUE="5080"><PARAM NAME="_StockProps" VALUE="1"><PARAM NAME="BackColor" VALUE="-2147483633"><PARAM NAME="Year" VALUE="2004"><PARAM NAME="Month" VALUE="7"><PARAM NAME="Day" VALUE="21"><PARAM NAME="DayLength" VALUE="1"><PARAM NAME="MonthLength" VALUE="1"><PARAM NAME="DayFontColor" VALUE="0"><PARAM NAME="FirstDay" VALUE="7"><PARAM NAME="GridCellEffect" VALUE="1"><PARAM NAME="GridFontColor" VALUE="10485760"><PARAM NAME="GridLinesColor" VALUE="-2147483632"><PARAM NAME="ShowDateSelectors" VALUE="-1"><PARAM NAME="ShowDays" VALUE="-1"><PARAM NAME="ShowHorizontalGrid" VALUE="-1"><PARAM NAME="ShowTitle" VALUE="-1"><PARAM NAME="ShowVerticalGrid" VALUE="-1"><PARAM NAME="TitleFontColor" VALUE="10485760"><PARAM NAME="ValueIsNull" VALUE="0"></OBJECT>
</td>
</tr>
<tr>
<td></td>
<td><input name="NewRepButton" type="button" Value="Generate" onclick="NewRep"></td>
</tr>
</table>
</form>
</BODY>
</HTML>



Thanks in advance

Suggestions can be emailed to krudi01@ca.com

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingCode Bank > FileSystemObject


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway