Hi Mark, that's interesting. Care to share the code that renames all the files in the directory from .dat to .txt then imports the files into an access table? Did you rename them because otherwise the import would fail? And did you actually move the files to another folder after completing the import?
Giorgio
--- In AccessDevelopers@yahoogroups.com, "m_bacheldor" <m_bacheldor@...> wrote:
>
> Toby,
> Thanks for the feedback on this one. I ended up finding a bit of code that renamed all the files in the directory from .dat to .txt. Then I found some code that I was able to adapt that would import the file into an access table. After the file i imported the file is then moved to an archive folder. So far it seems to be working good, but we shal see after I added it to the daily data uplaod process.
>
> Thanks again for your help,
>
> Mark
>
> --- In AccessDevelopers@yahoogroups.com, "Toby Bierly" <toby@> wrote:
> >
> > It depends on the format of the .dat file. Is it just a text file in a CSV type format or a tab delimited file? If so, then you can probably set it up to user the DoCmd.TransferText method to import the data to an Access table. You can look up the usage in the help. The trickiest part is you have to start doing the import manually and before you finish you save a Specification. That specification name is then one of the arguments to the TransferText method so it knows how many fields, what field types, what delimiters to look for, etc.
> >
> > Hope that helps,
> > Toby
> >
> > -----Original Message-----
> > From: AccessDevelopers@yahoogroups.com [mailto:AccessDevelopers@yahoogroups.com] On Behalf Of m_bacheldor
> > Sent: Wednesday, November 30, 2011 11:14 AM
> > To: AccessDevelopers@yahoogroups.com
> > Subject: [AccessDevelopers] Importing ,dat files
> >
> >
> >
> > Good afternoon everyone,
> >
> > I figured I had better ask my question here before I beat my head against the PC too many times trying to figure it out by myself.
> >
> > I have a folder where IT saves a .dat file daily for me. currently the folder has 3 months worth of files. I am hoping to put something together that would open a file read the information into an access table and then move the file to another folder.
> >
> > Unfortunately I got stuck with the trying to read a .dat file into access. The version of access that I have is 2003 so that could be a part of the problem.
> >
> > I don't have anything started as yet or I would post my code so I am open to any suggestions.
> >
> > Thank you,
> >
> > Mark
> >
>
Please zip all files prior to uploading to Files section.
Tidak ada komentar:
Posting Komentar