how i could import my txt file into access database 2010 using vb.net .
the txt file as follow :

08-14-13 08:09:26 001 07 0000020016 0100000000
08-14-13 13:12:06 001 07 0000020014 0300000000

i should take into consideration the space between columns becauase this txt file is exported from a certain software

thanks for any help

Recommended Answers

All 6 Replies

What is your level of expertise? Do you know anything about OleDB?

Yeh i do

acutually i need to create a oledb connection and insert the column of the txt file in the database , bu i shoudl took into consideration the spaces between columns because this text file is exported by default from an attendance software

thx fo your help

I love this free tutorial -- it has an entire chapter devoted to databases.

let me explain

here are my txt file structure :

Filed1       Field2     Field3        Field4       Field5      Field6

08-14-13 08:09:26 001 07 0000020016 0100000000
08-14-13 13:12:06 001 07 0000020014 0300000000

i want to import this txt file into ms access 2010 using oledb connection, each column of my txt file should be created as a field in the database .
for example table name import ( ID , time , date , Empid, state1,state2,state3 ). finally as you see the txt file has different spaces between columns , for example the space between field 1 and field 2 is 4 spaces between field2 and field3 is 5 spaces , because this txt file is exported from a software .

Thx for any help

Do you know SQL (Structured Query Language)? If not, then you need to lean at least the basics of it. Here are a few tutorials

I already gave you a link to a free tutorial that explains in detail now top connmect to a database. Just study that chapter.

Here is an example how to tokenize the lines if the text file

i know how to connect to database but i need the method or the query method to insert this txt file into access database , only the query

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.