471,603 Members | 1,842 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,603 software developers and data experts.

Convert Text (comma delimited) to Access mdb

jj

I have this comma delimited text file. I want to convert it in one sweep to
an access DB (mdb) format. I used the following code but it takes forever to
convert. Is there a faster way?

string strConn = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" +
strAppPath + "\\mydb.mdb";
OleDbConnection conn = new OleDbConnection(strConn);

conn.Open();

OleDbCommand cmd = new OleDbCommand();
cmd = new OleDbCommand("INSERT INTO mytable Select * from [Text;DATABASE="
+ strAppPath + ";].[mytextdata.txt]",conn );

cmd.ExecuteNonQuery();

conn.Close();

Any help is greatly appreicated and thank you in advance.
Feb 6 '06 #1
1 3052
jj,

You might want to consider using the Data Transformation Services. This
will allow you to specify different formats to convert data from/to which
should make the task very easy.

Here are some links to some resources which should help you out:

http://msdn.microsoft.com/library/de...basic_5zg3.asp

http://www.sqldts.com/

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"jj" <jj@hotmail.com> wrote in message
news:eF**************@TK2MSFTNGP11.phx.gbl...

I have this comma delimited text file. I want to convert it in one sweep
to
an access DB (mdb) format. I used the following code but it takes forever
to
convert. Is there a faster way?

string strConn = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" +
strAppPath + "\\mydb.mdb";
OleDbConnection conn = new OleDbConnection(strConn);

conn.Open();

OleDbCommand cmd = new OleDbCommand();
cmd = new OleDbCommand("INSERT INTO mytable Select * from
[Text;DATABASE="
+ strAppPath + ";].[mytextdata.txt]",conn );

cmd.ExecuteNonQuery();

conn.Close();

Any help is greatly appreicated and thank you in advance.

Feb 6 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Debbie CD UK | last post: by
2 posts views Thread by jj | last post: by
4 posts views Thread by JustSomeGuy | last post: by
15 posts views Thread by pakerly | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by MichaelMortimer | last post: by
reply views Thread by CCCYYYY | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.