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(sConnectionString)
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 said:
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?