473,671 Members | 2,298 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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=Micr osoft.Jet.OLEDB .4.0;Data Source=" +
strAppPath + "\\mydb.mdb ";
OleDbConnection conn = new OleDbConnection (strConn);

conn.Open();

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

cmd.ExecuteNonQ uery();

conn.Close();

Any help is greatly appreicated and thank you in advance.
Feb 6 '06 #1
1 3125
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.co m

"jj" <jj@hotmail.com > wrote in message
news:eF******** ******@TK2MSFTN GP11.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=Micr osoft.Jet.OLEDB .4.0;Data Source=" +
strAppPath + "\\mydb.mdb ";
OleDbConnection conn = new OleDbConnection (strConn);

conn.Open();

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

cmd.ExecuteNonQ uery();

conn.Close();

Any help is greatly appreicated and thank you in advance.

Feb 6 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
4323
by: Debbie CD UK | last post by:
I have a large amount of log files from an electronic contro tester that I need to import in to an Access database Unfortunately, they are not comma delimited or fixed with but different fields are on separte lines MO NO 123456 serial no xyz date Obviously , the Access import wizard can not handle this format.
1
9745
by: DCM Fan | last post by:
Access 2K, SP3 on Windows 2K, SP4 All, I have an import spec set up with quoted Identifiers and comma-separated values. The text file is produced by a 3rd-party program of which I have no control. It outputs all text fields surrounded by quotes, and all numeric fields w/o quotes. All fields are separated with commas. This has been working for 2 years, until today, when one of the data fields
2
2220
by: jj | last post by:
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();
5
2600
by: SMOlesen | last post by:
Hi I need to split a comma delimited text, however if the comma is between ' ' then no split should occur ie: Class.Value, 'true' , 'some text', 'false', 'text, text, text' should split into:
4
4789
by: JustSomeGuy | last post by:
Hi. I have a comma delimited text file that I want to parse. I was going to use fscanf from the C library but as my app is written in C++ I thought I'd use the std io stream library... My Text file looks like: First_Name, Last_Name, ID, Date/Of/Birth<newline> depending on the host the newline is either \n or \r\n
4
8174
by: raju5725 | last post by:
have a MS access table and I want to export it to comma delimited text file. How do I do this programmatically using VB.NET or C#? Thanks for any help in advance. Raju
2
2121
by: Ron | last post by:
so if my textbox is named textbox1 and my listbox is named ltsdisplay, for the button that would make this all happen I would just need to: lstdisplay.items.textbox1(delimited.Split(",".ToCharArray())) is that right? or no? I try this and I get an error...
1
10007
by: =?Utf-8?B?UmljaA==?= | last post by:
In the Registry at HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Jet \ 4.0 \ Engines \ Text the default key for Text Format is: "Format" = "CSVDelimited" I can use the following OleDB connection string with an OleDB dataAdapter to read a comma delimited text file when "Format" = "CSVDelimited"
15
17374
by: pakerly | last post by:
How would i do this, convert a test file to excel? Lets say my text file has fields like this: NUMBER NAME ADDRESS PHONE 11002 Test1 TestAddress1 111-2222 lets say the number field is 10 characters long, there is a space and Name field is 15 characters long, there is a space, address can be 25 characters long, there is a space and phone is 10 characters long I want to...
1
8597
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8669
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7428
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6222
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5692
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4222
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4403
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2809
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1807
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.