Click here to Skip to main content
14,643,812 members
Rate this:
Please Sign up or sign in to vote.
See more:
how to make database in access in vb.net from reading text files.i have one folder which have many text file . every text file name is currant date.


		    
Posted
Updated 17-Jun-13 18:41pm
v5
Comments
Richard MacCutchan 17-Jun-13 3:14am
   
Your question needs more detail. If you want to know how to create a database there are lots of articles to be found which include sample code. Try a Google search.
Rate this:
Please Sign up or sign in to vote.

Solution 1

I would first design and create a suitable database, then:
  • Find all the input files in the folder (they cannot share the same name, as your question seems to suggest).

For each found file:
  • Parse it in order to extract all the needed data.
  • Populate the database tables with such data.


Of course the detailed implementation depends on the actual structure of your input files.
   
Rate this:
Please Sign up or sign in to vote.

Solution 2

1) Add a reference to "Microsoft ADO Ext 6.0 for DDL and Security" to your project. (You'll find it under COM)
2) Add the using ADOX statement
3) Create the actual database:
Catalog cat = new Catalog();
cat.Create(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\Temp\myNewAccessDB.accdb;");

4) Add tables:
Table tab = new Table();
tab.Name = "MyTable";
tab.Columns.Append("ID", DataTypeEnum.adInteger);
tab.Columns.Append("UserName", DataTypeEnum.adVarWChar, 50);
cat.Tables.Append(tab);
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100