Link to home
Start Free TrialLog in
Avatar of abcd12_us
abcd12_us

asked on

linking a textfile into access databse using ADO in visual basic

I'm having data in text files , so I need to convert that data to microsoft access database using ADO in visual basic.
thanks,
looking for ur replay.
Avatar of BSmiley
BSmiley

More specifics are needed here.  Are your text files in a delimited format?  Are they all the same format or different?  Are you looking for a one-time manual method or a repeatable automated method?

Assuming they are delimited and all are the same format, you can open them using the delimited file importer:
- New table,
- select "Import Table",
- select a .txt file,
- and follow the prompts in the import wizard.

To automate, you can create a VB script to do this.

If you're having to repeatedly import to an existing table, you will need to use VB to open an ODBC datasource that points to the text file you need, import it using VB.
Why not link the table directly through Access as a linked text table?

Otherwise, you could use the file open command to open and read the text file.  You can put the text data into an array. Then you would open the Access db with ADO connection and recordset objects.  With the recordset open you can loop through the array and add the records to the recordset.
ASKER CERTIFIED SOLUTION
Avatar of Ruchi
Ruchi

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of abcd12_us

ASKER

thanx for ur reply.