Dear friends
I'm not strong vb.net programmer I'm just take course and I want to learn
from you
And I have Excellent knowledge of access 2003 (Expert)
In access 2003 to import data from CSV file you just select file import and
select text
And all CSV file will import in a new table with some steps with the wizard
know I want just import data from CSV file to Access using VB.NET
by button in vb.net form just click this button the vb.net imports data from
csv file to access mdb file
Mr. Paul
Microsoft MVP (Visual Basic)
give me this code :
Dim AccessConn As New
System.Data.OleDb.OleDbConnection("Provider=Micros oft.Jet.OLEDB.4.0;"
& _
"Data Source=C:\Test Files\db1 XP.mdb")
AccessConn.Open()
'New table
Dim AccessCommand As New System.Data.OleDb.OleDbCommand("SELECT *
INTO [TextFileTable] FROM
[Text;DATABASE=C:\Documents and Settings\...\My Documents\My
Database\Text].[Textfile.txt]",
AccessConn)
'Existing table
'Dim AccessCommand As New System.Data.OleDb.OleDbCommand("INSERT
INTO [TextFileTable] (F1,
F2, F3, F4, F5) SELECT F1, F2, F3, F4, F5 FROM [Text;DATABASE=C:\Documents
and Settings\...\My
Documents\My Database\Text].[Textfile.txt]", AccessConn)
AccessCommand.ExecuteNonQuery()
AccessConn.Close()
But there is error in the code I can't benefit form this code
The error in sql code
I'm edit this code like this but also there is error in sql code:
Dim cn As New OleDbConnection
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=test.mdb;Persist Security Info=False"
cn.Open()
Dim cmd As New OleDbCommand
cmd.CommandText = ("SELECT * INTO [TextFileTable] FROM [Text;DATABASE=
E:\a.csv]")
cmd.Connection = cn
cmd.ExecuteNonQuery()
cn.Close()
==
Can you edit the code for me
"Gillard" <gillard_georges@@@@@@@@@hotmail.comwrote in message
news:OM**************@TK2MSFTNGP02.phx.gbl...
by just having a look at the code project web site and searching CSV you
can find what you are looking for
"a" <a@a.netwrote in message
news:O7**************@TK2MSFTNGP02.phx.gbl...
>tell me the steps (the answer)
Thank you
"rowe_newsgroups" <ro********@yahoo.comwrote in message
news:00**********************************@34g2000 hsf.googlegroups.com...
On Jul 26, 4:50 am, "a" <a...@a.netwrote:
>>Dear friends
I want import data from CSV file to mdb file How can I do that in
vb.net?
ADO.NET
Thanks,
Seth Rowe [MVP]
http://sethrowe.blogspot.com/