Home > Archive > MS SQL Server DTS > July 2005 > File not found when renaming file using dts









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author File not found when renaming file using dts
AG

2005-07-26, 1:23 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_Su
ccess
End Function

Allan Mitchell

2005-07-26, 8:24 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@hotmail.com> wrote in message
news:1122397839.150719.291650@g49g2000cwa.googlegroups.com...
>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_Su
ccess
> End Function
>



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com