how to delete a flat file with DTS

how to delete a flat file with DTS

Post by RZ » Wed, 02 Apr 2003 05:09:48



Hi.

I'm using an activex script task to loop thru all the
files in a given folder and do some processing. I'm having
issues when the file is empty(size = 0) and I can't
deleted from dts(vbscript).

Here is my code:
Set oFolder = oFSO.GetFolder(sPath)
Set oFileCollection = oFolder.Files
For Each oFile in oFileCollection
        sString =  oFile.name
        if oFile.Size = 0 then                          
        testrz = "\\Athena\Clarify_Imports\" & sString
        if (oFso.FileExists(testrz)) then
           oFso.DeleteFile(testrz)
        end if
    end if
Next

'The deleteFile is NOT WORKING..is not deleting a file..
'If you have any ideas please let me know
'I also try the move method to move the file to an
archive 'directoy but it doesn't either..
'I have permissions for the folder..the process works if
the file has data !! PLease Help!! RZ

 
 
 

how to delete a flat file with DTS

Post by JFB » Wed, 02 Apr 2003 05:30:26


RZ try...
oFSO.DeleteFile testrz, True
JFB


Quote:> Hi.

> I'm using an activex script task to loop thru all the
> files in a given folder and do some processing. I'm having
> issues when the file is empty(size = 0) and I can't
> deleted from dts(vbscript).

> Here is my code:
> Set oFolder = oFSO.GetFolder(sPath)
> Set oFileCollection = oFolder.Files
> For Each oFile in oFileCollection
>         sString =  oFile.name
> if oFile.Size = 0 then
> testrz = "\\Athena\Clarify_Imports\" & sString
> if (oFso.FileExists(testrz)) then
>    oFso.DeleteFile(testrz)
> end if
>     end if
> Next

> 'The deleteFile is NOT WORKING..is not deleting a file..
> 'If you have any ideas please let me know
> 'I also try the move method to move the file to an
> archive 'directoy but it doesn't either..
> 'I have permissions for the folder..the process works if
> the file has data !! PLease Help!! RZ


 
 
 

how to delete a flat file with DTS

Post by RZ » Wed, 02 Apr 2003 05:41:32


Thanks JFB. I try that but that didn't work.
I'm getting this error:

Step Error Source: Microsoft Data Transformation Services
(DTS) Package
Step Error Description:Error Code: 0
Error Source= Microsoft VBScript runtime error
Error Description: Permission denied

Error on Line 80
line 80 is where i'm using deletefile.

>-----Original Message-----
>RZ try...
>oFSO.DeleteFile testrz, True
>JFB



>> Hi.

>> I'm using an activex script task to loop thru all the
>> files in a given folder and do some processing. I'm
having
>> issues when the file is empty(size = 0) and I can't
>> deleted from dts(vbscript).

>> Here is my code:
>> Set oFolder = oFSO.GetFolder(sPath)
>> Set oFileCollection = oFolder.Files
>> For Each oFile in oFileCollection
>>         sString =  oFile.name
>> if oFile.Size = 0 then
>> testrz = "\\Athena\Clarify_Imports\" & sString
>> if (oFso.FileExists(testrz)) then
>>    oFso.DeleteFile(testrz)
>> end if
>>     end if
>> Next

>> 'The deleteFile is NOT WORKING..is not deleting a file..
>> 'If you have any ideas please let me know
>> 'I also try the move method to move the file to an
>> archive 'directoy but it doesn't either..
>> 'I have permissions for the folder..the process works if
>> the file has data !! PLease Help!! RZ

>.

 
 
 

how to delete a flat file with DTS

Post by JFB » Wed, 02 Apr 2003 05:52:52


Aaaaaa...
You don't have permission to delete files on you network...
JFB


> Thanks JFB. I try that but that didn't work.
> I'm getting this error:

> Step Error Source: Microsoft Data Transformation Services
> (DTS) Package
> Step Error Description:Error Code: 0
> Error Source= Microsoft VBScript runtime error
> Error Description: Permission denied

> Error on Line 80
> line 80 is where i'm using deletefile.

> >-----Original Message-----
> >RZ try...
> >oFSO.DeleteFile testrz, True
> >JFB



> >> Hi.

> >> I'm using an activex script task to loop thru all the
> >> files in a given folder and do some processing. I'm
> having
> >> issues when the file is empty(size = 0) and I can't
> >> deleted from dts(vbscript).

> >> Here is my code:
> >> Set oFolder = oFSO.GetFolder(sPath)
> >> Set oFileCollection = oFolder.Files
> >> For Each oFile in oFileCollection
> >>         sString =  oFile.name
> >> if oFile.Size = 0 then
> >> testrz = "\\Athena\Clarify_Imports\" & sString
> >> if (oFso.FileExists(testrz)) then
> >>    oFso.DeleteFile(testrz)
> >> end if
> >>     end if
> >> Next

> >> 'The deleteFile is NOT WORKING..is not deleting a file..
> >> 'If you have any ideas please let me know
> >> 'I also try the move method to move the file to an
> >> archive 'directoy but it doesn't either..
> >> 'I have permissions for the folder..the process works if
> >> the file has data !! PLease Help!! RZ

> >.

 
 
 

how to delete a flat file with DTS

Post by RZ » Wed, 02 Apr 2003 06:10:13


Hi JFB
How can I find out the default user account that dts is
using so I can provide the priviles to read write etc?
I'm using sql server 7 by the way
Thanks again! RZ

>-----Original Message-----
>Aaaaaa...
>You don't have permission to delete files on you
network...
>JFB



>> Thanks JFB. I try that but that didn't work.
>> I'm getting this error:

>> Step Error Source: Microsoft Data Transformation
Services
>> (DTS) Package
>> Step Error Description:Error Code: 0
>> Error Source= Microsoft VBScript runtime error
>> Error Description: Permission denied

>> Error on Line 80
>> line 80 is where i'm using deletefile.

>> >-----Original Message-----
>> >RZ try...
>> >oFSO.DeleteFile testrz, True
>> >JFB



>> >> Hi.

>> >> I'm using an activex script task to loop thru all the
>> >> files in a given folder and do some processing. I'm
>> having
>> >> issues when the file is empty(size = 0) and I can't
>> >> deleted from dts(vbscript).

>> >> Here is my code:
>> >> Set oFolder = oFSO.GetFolder(sPath)
>> >> Set oFileCollection = oFolder.Files
>> >> For Each oFile in oFileCollection
>> >>         sString =  oFile.name
>> >> if oFile.Size = 0 then
>> >> testrz = "\\Athena\Clarify_Imports\" & sString
>> >> if (oFso.FileExists(testrz)) then
>> >>    oFso.DeleteFile(testrz)
>> >> end if
>> >>     end if
>> >> Next

>> >> 'The deleteFile is NOT WORKING..is not deleting a
file..
>> >> 'If you have any ideas please let me know
>> >> 'I also try the move method to move the file to an
>> >> archive 'directoy but it doesn't either..
>> >> 'I have permissions for the folder..the process
works if
>> >> the file has data !! PLease Help!! RZ

>> >.

>.

 
 
 

how to delete a flat file with DTS

Post by JFB » Wed, 02 Apr 2003 06:21:04


You should be able to find it in package properties.
JFB


> Hi JFB
> How can I find out the default user account that dts is
> using so I can provide the priviles to read write etc?
> I'm using sql server 7 by the way
> Thanks again! RZ
> >-----Original Message-----
> >Aaaaaa...
> >You don't have permission to delete files on you
> network...
> >JFB



> >> Thanks JFB. I try that but that didn't work.
> >> I'm getting this error:

> >> Step Error Source: Microsoft Data Transformation
> Services
> >> (DTS) Package
> >> Step Error Description:Error Code: 0
> >> Error Source= Microsoft VBScript runtime error
> >> Error Description: Permission denied

> >> Error on Line 80
> >> line 80 is where i'm using deletefile.

> >> >-----Original Message-----
> >> >RZ try...
> >> >oFSO.DeleteFile testrz, True
> >> >JFB



> >> >> Hi.

> >> >> I'm using an activex script task to loop thru all the
> >> >> files in a given folder and do some processing. I'm
> >> having
> >> >> issues when the file is empty(size = 0) and I can't
> >> >> deleted from dts(vbscript).

> >> >> Here is my code:
> >> >> Set oFolder = oFSO.GetFolder(sPath)
> >> >> Set oFileCollection = oFolder.Files
> >> >> For Each oFile in oFileCollection
> >> >>         sString =  oFile.name
> >> >> if oFile.Size = 0 then
> >> >> testrz = "\\Athena\Clarify_Imports\" & sString
> >> >> if (oFso.FileExists(testrz)) then
> >> >>    oFso.DeleteFile(testrz)
> >> >> end if
> >> >>     end if
> >> >> Next

> >> >> 'The deleteFile is NOT WORKING..is not deleting a
> file..
> >> >> 'If you have any ideas please let me know
> >> >> 'I also try the move method to move the file to an
> >> >> archive 'directoy but it doesn't either..
> >> >> 'I have permissions for the folder..the process
> works if
> >> >> the file has data !! PLease Help!! RZ

> >> >.

> >.

 
 
 

1. Accessing Flat files through DTS Flat File OLE DB Provider

Hello,

I am interested in defining a DTS package that transforms data from
flat files to SQL Server table.

I would like to access the flat files through the DTS Flat File OLE DB
Provider.

But, I couldn't find any information on how to define the metadata of
the Flat files.

Any help would be appreciated.

Thanks in advance,
Hayim Salti

--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---

2. DSN names access

3. How to delete a flat file in SQL

4. Defining Aliases at runtime

5. Using the OLE DB flat file provider to automate DTS w/VB6

6. executing a DTS package automatically

7. DTS Flat file load

8. Installing ORACLE OCI

9. DTS Problem with Flat File Imports

10. Collate Error in DTS Import of ASCII flat file

11. How to use the flat file provider with VB6 automated DTS

12. DTS to odbc flat file

13. Problem with DTS export to flat file