Hi,
I'm trying to write a small application that imports data in a column from a csv file into a table in access. I'm very new to programming, but this is what i've come up with so far. It runs, but it's not actually bringing the data over to my database.
Can anyone help?
Here is the code:
I'm trying to write a small application that imports data in a column from a csv file into a table in access. I'm very new to programming, but this is what i've come up with so far. It runs, but it's not actually bringing the data over to my database.
Can anyone help?
Here is the code:
Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim dbPath As String
dbPath = "f:\db1.mdb"
Dim oConn As OleDb.OleDbConnection
oConn = New OleDb.OleDbConnection
oConn.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source = F:\db1.mdb;Persist Security Info=False"
oConn.Open()
Dim cmd As OleDb.OleDbCommand
cmd = New OleDb.OleDbCommand
cmd.CommandText = ("INSERT INTO tblName(Field1) FROM [Text;DATABASE=F:\myCSVFile.csv](Numbers)")
oConn.Close()
End Sub

Comment