test incoming files for bytes

DK8

Registered User.
Local time
Today, 16:44
Joined
Apr 19, 2007
Messages
72
I need to add some code to our access 2002 database to test incoming files for bytes, zero byte files in particular. Our system will then pick out the zero byte files for emailing to our customers. Can someone provide code for testing for bytes or provide me some direction on this matter? Thank you!
 
test for bytes code

I need to add some code to our access 2002 database to test incoming files for bytes, zero byte files in particular. Our system will then pick out the zero byte files for emailing to our customers. Can someone provide code for testing for bytes or provide me some direction on this matter? Thank you!
 
look for a function called Filelen
 
Code:
Dim lngLength As Long

lngLength = FileLen("path and file name here")

That should get you started...
 
And please don't post the same question more than once. You posted this question in the VB category too.

EDIT:

I merged the two posts together.
 
Last edited:
test numerous files for bytes

Thank you all for replying, I should have been more specific. I have approximately 80 seperate files to test for bytes. Does anyone know of a way to test them collectively or do I need to add code to each seperate file name? Thank you again.
 
Thank you all for replying, I should have been more specific. I have approximately 80 seperate files to test for bytes. Does anyone know of a way to test them collectively or do I need to add code to each seperate file name? Thank you again.

Aren't you trying to find zero-length files? I'd think that you would need to check each file individually to do that... so your code would iterate through your file names, and you'd use the FileLen function to retrieve the file size of each file. Then your code would take whatever action that you'd need on the zero-length ones.
 
Yes, I am looking for all the zero length files first and then would like to seperate them from the files with data. I need to have the two seperated for email purposes. We currently have two functions in our system which we will use: email with blank file and email with data file. I hope this helps you to understand our process a little more. Could you provide an example of code showing how to iterate through the files and how to use the FileLen function to retrieve the file size of each file? I'm new to VBA, so any help you could provide would be great.
 

Users who are viewing this thread

Back
Top Bottom