![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, I'm trying to access a file from our shared SQL Server to our shared Web Server using a DTS Package. It's failing at the FileSystemObject here: '''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''' ''''''''''''''''''''''''''''''''''''''' Set objFSO = CreateObject("Scripting.FileSystemObject") strLogFile = "\\webb18\c$\inetpub\brewandvine\images\log.tx t" ' ' Check to see if a log file exists if it does open it. If not create it. ' If not objFSO.FileExists(strLogFile) then <--------Path Not Found Set master = objfso.CreateTextFile(strLogFile) master.WriteLine "File Created @ " & now master.WriteLine " In LAST File Exists Routine @ " & now Else Set master = objFSO.OpenTextFile(strLogFile,8) master.WriteLine master.WriteLine "File Opened @ " & now master.WriteLine " In LAST File Exists Routine @ " & now End if '''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''' ''''''''''''''''''''''''''''''''''''''' I'm using a UNC path our host gave me...Anyone know of anything that could be causing the error? TIA, ~Gordon |
#3
| |||
| |||
|
#4
| |||
| |||
|
|
In article <54cdjvs2hoj7il4gbavftskdaidleabc5o (AT) 4ax (DOT) com>, Simple Simon reply (AT) newsgroup (DOT) only> writes Hi, I'm trying to access a file from our shared SQL Server to our shared Web Server using a DTS Package. It's failing at the FileSystemObject here: '''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''' ''''''''''''''''''''''''''''''''''''''' Set objFSO = CreateObject("Scripting.FileSystemObject") strLogFile = "\\webb18\c$\inetpub\brewandvine\images\log.tx t" ' ' Check to see if a log file exists if it does open it. If not create it. ' If not objFSO.FileExists(strLogFile) then <--------Path Not Found Set master = objfso.CreateTextFile(strLogFile) master.WriteLine "File Created @ " & now master.WriteLine " In LAST File Exists Routine @ " & now Else Set master = objFSO.OpenTextFile(strLogFile,8) master.WriteLine master.WriteLine "File Opened @ " & now master.WriteLine " In LAST File Exists Routine @ " & now End if '''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''' ''''''''''''''''''''''''''''''''''''''' I'm using a UNC path our host gave me...Anyone know of anything that could be causing the error? TIA, ~Gordon Does it actually error? Doing a simple test with like oFSO.FileExists(sFilename) will return false if the file does not exist, or if there are no permissions on the share, or even if the machine does not exist, but none of these scenarios gives me an error. If you are not getting an error, but the FileExists function returns false then it implies the file really doesn't exist, or more likely you have the wrong machine or insufficient permissions on the share. The c$ share is reserved for machine administrators only, so you may not be an admin on the web server, even if you are on the SQL server. |
#5
| |||
| |||
|
|
First thoughts are that whilst it is good to see you using UNC paths I note that you have chosen an admin share. "\\webb18\c$\inetpub\brewandvine\images\log.tx t" I tested the following and it works for me so I would try reworking the file location to not use the Amdin share Function Main() dim objFSO, strLogFile, master Set objFSO = CreateObject("Scripting.FileSystemObject") strLogFile = "c:\log.txt" ' ' Check to see if a log file exists if it does open it. If not create it.' If not objFSO.FileExists(strLogFile) then '<--------Path Not Found Set master = objfso.CreateTextFile(strLogFile) master.WriteLine "File Created @ " & now master.WriteLine " In LAST File Exists Routine @ " & now Else Set master = objFSO.OpenTextFile(strLogFile,8) master.WriteLine master.WriteLine "File Opened @ " & now master.WriteLine " In LAST File Exists Routine @ " & now End if master.close set master = nothing set objFSO = Nothing Main = DTSTaskExecResult_Success End Function |
#6
| |||
| |||
|
|
Hey Darren! Thxs for the reply...Jeez, r u always on here? LOL I checked with my host and they said it aint gonna happen because of permissions across the network ![]() ~Gordon On Sun, 10 Aug 2003 22:25:40 +0100, Darren Green darren.green (AT) reply-to-newsgroup-only (DOT) uk.com> wrote: In article <54cdjvs2hoj7il4gbavftskdaidleabc5o (AT) 4ax (DOT) com>, Simple Simon reply (AT) newsgroup (DOT) only> writes Hi, I'm trying to access a file from our shared SQL Server to our shared Web Server using a DTS Package. It's failing at the FileSystemObject here: '''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''' ''''''''''''''''''''''''''''''''''''''' Set objFSO = CreateObject("Scripting.FileSystemObject") strLogFile = "\\webb18\c$\inetpub\brewandvine\images\log.tx t" ' ' Check to see if a log file exists if it does open it. If not create it. ' If not objFSO.FileExists(strLogFile) then <--------Path Not Found Set master = objfso.CreateTextFile(strLogFile) master.WriteLine "File Created @ " & now master.WriteLine " In LAST File Exists Routine @ " & now Else Set master = objFSO.OpenTextFile(strLogFile,8) master.WriteLine master.WriteLine "File Opened @ " & now master.WriteLine " In LAST File Exists Routine @ " & now End if '''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''' ''''''''''''''''''''''''''''''''''''''' I'm using a UNC path our host gave me...Anyone know of anything that could be causing the error? TIA, ~Gordon Does it actually error? Doing a simple test with like oFSO.FileExists(sFilename) will return false if the file does not exist, or if there are no permissions on the share, or even if the machine does not exist, but none of these scenarios gives me an error. If you are not getting an error, but the FileExists function returns false then it implies the file really doesn't exist, or more likely you have the wrong machine or insufficient permissions on the share. The c$ share is reserved for machine administrators only, so you may not be an admin on the web server, even if you are on the SQL server. |
![]() |
| Thread Tools | |
| Display Modes | |
| |