By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,970 Members | 1,669 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,970 IT Pros & Developers. It's quick & easy.

Check for Flat File

P: n/a
ED
I currently have 2 oracle databases that my access database is going
to gather data from. The IT department wants to give me data snaps in
the form of a flat file. They will FTP the flat file to the location
that I need and I am wondering how I would be able to check to make
sure that the flat file is in the correct location before I
automatically append it to an access table. Basically, I am
attempting to have some automatic validation so that the user of the
system will recieve a message to contact IT if the file is not there.
Any ideas on the process.

Thanks
Nov 13 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
da******@hotmail.com (ED) wrote in
news:ad**************************@posting.google.c om:
I currently have 2 oracle databases that my access database is
going to gather data from. The IT department wants to give me
data snaps in the form of a flat file. They will FTP the flat
file to the location that I need and I am wondering how I
would be able to check to make sure that the flat file is in
the correct location before I automatically append it to an
access table. Basically, I am attempting to have some
automatic validation so that the user of the system will
recieve a message to contact IT if the file is not there. Any
ideas on the process.

Thanks


bFileIsThere = (dir$("drive:\dir\subdir\filename.ext") <> "")
But that won't tell you if it's a new version or the old one,
unless you delete the file after importing..
Bob Quintal
Nov 13 '05 #2

P: n/a
I am assumming that I need to write that in VBA. Use an if statement to
display a message box if the file is not present and if it is present
appened it to the table. I am struggling to write the code. Any help
in pointing in the right direction would be great.

Thanks


*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #3

P: n/a
Ernie DAmato wrote:
I am assumming that I need to write that in VBA. Use an if statement to
display a message box if the file is not present and if it is present
appened it to the table. I am struggling to write the code. Any help
in pointing in the right direction would be great.

Thanks

Check my response for loading the file

On Error Goto Err_Handler
If Dir("C:\Test\Test.Txt") > "" Then
Docmd.TransferText ....
'keep an archive in C:\Test\Archive...
'if you have an archive directory and want to
'save them
FileCopy "C:\Test\Test.Txt" "C:\Test\Archive\Test.Txt"
'delete the file once transfered
Kill "C:\Test\Test.Txt"
Endif

Exit_Handler:
Exit Sub

Err_Handler:
msgbox Err.Number & " " & Err.Description,,_
"An error occurred. Import incomplete"
Resume Exit_Handler
End sub

Nov 13 '05 #4

P: n/a
Thanks for all the help

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.