How can I import to Access 2003 from csv-file via VBA?

H

hanski

Hi.

I can manually import from csv-file easily and I have allready a table
in Access for it. I choose only which file I want to import.

Is it possible to do automatic via VBA so that I would tell it only
the name of the csv-file which to be imported?

hanski
 
H

hanski

Use TransferText.

--
Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users -http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.










- Näytä siteerattu teksti -

I tried it and it almost made it!

I have phone numbers in my csv-file. There are two formats: 0445679
and 044-5679.
Latter format do not come to my access table, because of importerror.
Allthough I change the of the field in my access table from number to
text, it does not help.
How could I get both formats to my access table?

hanski
 
A

Allen Browne

When you manually import the file, the Advanced button lets you create an
import/export spec.

Once you have that set up, you can tell it to use that spec in your
TransferText.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Use TransferText.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users -http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.






- Näytä siteerattu teksti -

I tried it and it almost made it!

I have phone numbers in my csv-file. There are two formats: 0445679
and 044-5679.
Latter format do not come to my access table, because of importerror.
Allthough I change the of the field in my access table from number to
text, it does not help.
How could I get both formats to my access table?

hanski
 
H

hanski

When you manually import the file, the Advanced button lets you create an
import/export spec.

Once you have that set up, you can tell it to use that spec in your
TransferText.

--
Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users -http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.





I tried it and it almost made it!

I have phone numbers in my csv-file. There are two formats: 0445679
and 044-5679.
Latter format do not come to my access table, because of importerror.
Allthough I change the of the field in my access table from number to
text, it does not help.
How could I get both formats to my access table?

hanski- Piilota siteerattu teksti -

- Näytä siteerattu teksti -

Thanks Allen, I managed to do it!

hanski
 

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