PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
convert comma delimited text to access mdb
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
convert comma delimited text to access mdb
![]() |
convert comma delimited text to access mdb |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
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. |
|
|
|
#2 |
|
Guest
Posts: n/a
|
Is this a one-off task or something that you would need to do every time a
program runs? I don't know much about Access, but with SQL Server it's possible to do a bulk insert which can be frighteningly fast. |
|
|
|
#3 |
|
Guest
Posts: n/a
|
The conversion is done at the end of my scan application. For a one
scan(that takes long hours) I will do the conversion at the end inorder to create reports. any help please "Griff" <howling@the.moon> wrote in message news:OtwBKRzKGHA.140@TK2MSFTNGP12.phx.gbl... > Is this a one-off task or something that you would need to do every time a > program runs? > > I don't know much about Access, but with SQL Server it's possible to do a > bulk insert which can be frighteningly fast. > > |
|
|
|
#4 |
|
Guest
Posts: n/a
|
can you send me the one for SQl server and then I can try to modfiy for
Access. Thanks "Griff" <howling@the.moon> wrote in message news:OtwBKRzKGHA.140@TK2MSFTNGP12.phx.gbl... > Is this a one-off task or something that you would need to do every time a > program runs? > > I don't know much about Access, but with SQL Server it's possible to do a > bulk insert which can be frighteningly fast. > > |
|
|
|
#5 |
|
Guest
Posts: n/a
|
On Mon, 6 Feb 2006 10:36:00 -0500, "jj" <jj@hotmail.com> wrote:
¤ 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(); How many lines are there in your text file? Just an FYI, there is no bulk insert capability in Jet. Paul ~~~~ Microsoft MVP (Visual Basic) |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

