Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Weird FileSystemObject error.

Status
Not open for further replies.

qwert231

Programmer
Sep 4, 2001
756
US
I know, I know, 'Permission denied' isn't weird, in itself. But I have applied everything up to full access to IUSER_ComputerName on the webservers domain.
Here's the scoop. I have my Webserver on Domain1. I have my files on Domain2\SQLServer. I am trying to access a .txt file with this command:
Set fLayout = oFSO.OpenTextFile("K:\Layouts\Senior Pkgs\", ForReading, TristateTrue)

Now, when I am at my test station (Domain2\TestSystem) this works fine. Both my TestSystem and the Webserver have K: mapped exactly the same. Any ideas why I get this message?
 
Here is refined test code.

<%
'>>>>Begin DP2 integration.<<<<
Dim jobName, jobPath, jobFinal
jobName = &quot;Job_Y10079_1&quot;
jobPath = &quot;K:\OrderJobs\Job_Y10079_1\&quot;
jobFinal = jobPath & jobName
call GetImagePath(&quot;666666&quot;, &quot;100&quot;)
Dim imgPath
if NOT ordImgSet.EOF then imgPath = ordImgSet(&quot;Path&quot;)
'>>>>Begin creating the Job file.<<<<
Dim oFSO, fLayout, fJob, fldr
Set oFSO = CreateObject(&quot;Scripting.FileSystemObject&quot;)
Set fLayout = oFSO.OpenTextFile(&quot;K:\Layouts\Senior Pkgs\YBK-C-DLS.txt&quot;, ForReading, TristateTrue)
if NOT (oFSO.FolderExists(jobPath)) then Set fldr = oFSO.CreateFolder(jobPath)
Set fJob = oFSO.CreateTextFile(jobFinal)
fJob.Close
fLayout.Close
%>
 
qwert231,

I use this to map a drive and then disconnect after done.

drv = &quot;X:&quot;
share = &quot;\\servername\e$&quot;
user = &quot;domain\username&quot;
pwd = &quot;yourpassword&quot;

WshNetwork.MapNetworkDrive drv, share, false, user, pwd


fengshui_1998
 
K, now I get this:
Microsoft VBScript runtime error '800a01f4'
Variable is undefined: 'WScript'
/test.asp, line 38

Line 38:
Set WshNetwork = WScript.CreateObject(&quot;WScript.Network&quot;)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top