Hi scorpion,
You probably have a CSV file that you want to import to Database. Here is an
example how to fill datatable from CSV file. It will get you started
Private Sub ConnectToText_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)
Handles ConnectToText.Click
'Establish a connection to the data source.
Dim sConnectionString As String
sConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=d:\My Documents\TextFiles;Extended
Properties=Text;"
Dim objConn As New
System.Data.OleDb.OleDbConnection(sConnectionStrin g)
objConn.Open()
Dim da As New System.Data.OleDb.OleDbDataAdapter("Select * from
People.txt", objConn)
Dim ds As New DataSet("PeopleFile")
da.Fill(ds, "People.txt")
Dim dt As DataTable
dt = ds.Tables("People.txt")
Dim drCurrent As DataRow
For Each drCurrent In dt.Rows
Console.WriteLine("{0} {1}", _
drCurrent("0").ToString, _
drCurrent("1").ToString)
Next
objConn.Close()
End Sub
"scorpion53061" <sc************@nospamhereeveryahoo.com> wrote in message
news:u#**************@TK2MSFTNGP12.phx.gbl...
How does this help with importing text files into MS Access? What I am
trying to do is code an action that duplicates the MS Access Import Wizard
we use when we want to import a text file into access?
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:c6************@ID-208219.news.uni-berlin.de... * "scorpion53061" <sc************@nospamhereeveryahoo.com> scripsit: I am attempting to automate the process within a vb.net windows application of importing a text file into an access database (setting the column
seperators, first row being column names and such) but I am not
finding examples of this on the net? Has anyone ran across such a thing?
Did you have a look at <URL:http://www.connectionstrings.com/>?
--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>