Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / November 2007

Tip: Looking for answers? Try searching our database.

Insert ascii into Access

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kevamer - 21 Nov 2007 10:18 GMT
Hi

I'm trying to insert records from a ASCII file to access.
Seen somewhere on the internet that something like this should work :

 'SELECT * INTO MyTable '+
   'FROM OPENDATASOURCE("Microsoft.JET.OLEDB.4.0,Data
Source=C:\Map;Extended Properties="text;HDR=No") '+
   '[FileName#csv]'

Can anybody help me with the exact syntax of this statement. I don't know
where to fill in what.

And is it perhaps also possible to insert records from an ASCII file with
standard record length instead of from a CSV file?

Thanks
Kees
Dale Fye - 21 Nov 2007 12:43 GMT
If you want to do the import programmatically, check out the TransferText
method in Access help.  However, the first time you do it, I strongly
recommend you go through the manual process.

1. From the Main menu, select File -> Get External Data -> Import
2. Select the file you want to import (don't forget to change the file type
to the Text Files option (*.txt, *.csv, *.tab, *.asc). Click Import
3. Now you should be looking at the Import Text Wizard, which gives you a
couple of options.  If you select the Advanced.. button, it will open the
Import Specification window, which allows you to define the field names of
the fields, their data type, whether they should be indexed, and even allows
you to identify fields to skip.  Make sure you save your specification,
because you can use it in the TransferText method.  Finish going through the
wizard to get your first copy of the table.  In the future, you can simply
import to this table.

HTH
Dale

Signature

Don''t forget to rate the post if it was helpful!

Email address is not valid.
Please reply to newsgroup only.

> Hi
>
[quoted text clipped - 14 lines]
> Thanks
> Kees
Kevamer - 21 Nov 2007 12:57 GMT
My import must be done programmatically with a delphi program.
Thats why i'm looking for the right syntax.

thanks

Kees

> If you want to do the import programmatically, check out the TransferText
> method in Access help.  However, the first time you do it, I strongly
[quoted text clipped - 36 lines]
>> Thanks
>> Kees
Dale Fye - 21 Nov 2007 14:02 GMT
I'm not familiar with Delphi.  Are you saying you want to use Delphi to load
the text file into Access?  Why not use Access to do it?  As I said, I would
do the import manually the first time, so I could setup the import
specification, but would then do it in code from there on out.

Dale
Signature

Don''t forget to rate the post if it was helpful!

Email address is not valid.
Please reply to newsgroup only.

> My import must be done programmatically with a delphi program.
> Thats why i'm looking for the right syntax.
[quoted text clipped - 43 lines]
> >> Thanks
> >> Kees
Kevamer - 21 Nov 2007 15:11 GMT
Hi Dale,

I'm in the middle of automating an export of a financial database to
MSAccess.  This will be done every night, so manual is out of the question.
Im not an expert in MSAcces, but we have a user here that makes his analysis
the best with Access

Regards, kees

> I'm not familiar with Delphi.  Are you saying you want to use Delphi to
> load
[quoted text clipped - 60 lines]
>> >> Thanks
>> >> Kees
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.