dbTalk Databases Forums  

File not found when renaming file using dts

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss File not found when renaming file using dts in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
AG
 
Posts: n/a

Default File not found when renaming file using dts - 07-26-2005 , 12:10 PM






I am running this activex script on a server which searchers for a file
b.txt and renames it as ba.txt on the c drive of a server.I get the
error vb script error error code 0 when executing the movefile step
oFSO.MoveFile sSourceFile , sDestinationFile.
Both these files exists on the server.

What could be going wrong?Using xp_cmdshell and dos rename command i
can rename the files,


AG

option explicit
Function Main()

Dim oFSO
Dim sSourceFile
Dim sDestinationFile
Dim dds

Set oFSO = CreateObject("Scripting.FileSystemObject")
sSourceFile ="C:\b.txt"

sDestinationFile = "C:\ba.txt"
msgbox sSourceFile
msgbox sDestinationFile
oFSO.MoveFile sSourceFile , sDestinationFile
' Clean Up'
Set oFSO = Nothing
Main = DTSTaskExecResult_Success
End Function


Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: File not found when renaming file using dts - 07-26-2005 , 02:13 PM






Thanks for the great repo.

Unfortunately I can report that it works for me.

This does not work for you when you execute the single task manually?

--



Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - You thought DTS was good. here we show you the new stuff.
www.konesans.com - Consultancy from the people who know


"AG" <ajayz90 (AT) hotmail (DOT) com> wrote

Quote:
I am running this activex script on a server which searchers for a file
b.txt and renames it as ba.txt on the c drive of a server.I get the
error vb script error error code 0 when executing the movefile step
oFSO.MoveFile sSourceFile , sDestinationFile.
Both these files exists on the server.

What could be going wrong?Using xp_cmdshell and dos rename command i
can rename the files,


AG

option explicit
Function Main()

Dim oFSO
Dim sSourceFile
Dim sDestinationFile
Dim dds

Set oFSO = CreateObject("Scripting.FileSystemObject")
sSourceFile ="C:\b.txt"

sDestinationFile = "C:\ba.txt"
msgbox sSourceFile
msgbox sDestinationFile
oFSO.MoveFile sSourceFile , sDestinationFile
' Clean Up'
Set oFSO = Nothing
Main = DTSTaskExecResult_Success
End Function




Reply With Quote
Reply




Thread Tools
Display Modes

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



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.