Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Disk Not Ready Error !!

Author  Topic 

trusted4u
Posting Yak Master

109 Posts

Posted - 2003-05-19 : 03:35:41

Hello Everybody :
When I execute a package which contains the following vbscript, it gives me an error "Disk Not Ready" for this statement =>
Set strCommand = FileSysObj.CreateTextFile(srtCommandFile, True)
*****************
I want to create a file in an existing folder d:\Dev.

Dim FileSysObj

Function Main()
Dim srtCommandFile
strFolder = "d:\Dev"
srtCommandFile = strFolder + "\FtpCommands.Cmd"
'/*------- Create Folders -----*/
Set FileSysObj = CreateObject("Scripting.FileSystemObject")
'/*------- Create File Command and FTP Commandes ------*/

If FileSysObj.FileExists(strCommandfile) = True Then FileSysObj.DeleteFile strCommandfile
Set strCommand = FileSysObj.CreateTextFile(srtCommandFile,True)
strCommand.WriteLine "Open " + "ftp://ftp.win.ne.jp/pub/network/security/sjg/bftp-2.2.5.tar.gz"

strCommand.WriteLine "USER " + "Marjo"
strCommand.WriteLine "abc"
strCommand.Writeline "Get " + "20030517.db1 " + "d:\dev\20030517.db1"
strCommand.WriteLine "Bye"
Set strCommand = Nothing
Set FileSysObj = Nothing
Main = DTSTaskExecResult_Success
End Function


Thanks
-Marjo.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2003-05-19 : 12:26:34
I realize that this vbscript is running inside of a DTS package, but the question isn't about SQL Server so I'm not sure that you are going to find a lot of help on this forum. You might want to post this question on a site that discusses VB and VBScript, such as [url]http://vbforums.com[/url].

I would also suggest looking at the code examples at [url]http://www.devguru.com/Technologies/vbscript/quickref/vbscript_intro.html[/url].

To troubleshoot this problem outside of SQL Server, copy your VBScript into a text file and save it was a vbs extension. [url][/url]

Tara
Go to Top of Page
   

- Advertisement -