Insert ascii into Access

K

Kevamer

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
 
G

Guest

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
 
K

Kevamer

My import must be done programmatically with a delphi program.
Thats why i'm looking for the right syntax.

thanks

Kees



Dale Fye said:
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

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

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


Kevamer said:
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
 
G

Guest

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
--
Don''t forget to rate the post if it was helpful!

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


Kevamer said:
My import must be done programmatically with a delphi program.
Thats why i'm looking for the right syntax.

thanks

Kees



Dale Fye said:
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

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

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


Kevamer said:
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
 
K

Kevamer

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



Dale Fye said:
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
--
Don''t forget to rate the post if it was helpful!

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


Kevamer said:
My import must be done programmatically with a delphi program.
Thats why i'm looking for the right syntax.

thanks

Kees



Dale Fye said:
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

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

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


:

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top