September 24, 2008 at 8:26 am
Hi,
I am using the following code in vb.net to import data from a CSV file (a simple text file).
Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=MyDB.mdb")
Dim cmd As New OleDbCommand("SELECT * INTO tblNewOne FROM [Text;Database=C:\;Hdr=No].[Myfile.txt]", conn)
conn.Open()
Try
cmd.ExecuteNonQuery()
Catch ex As Exception
MsgBox(ex.ToString)
End Try
conn.Close()
When executed the first time, the contents from the file are imported into the table. After about 5 min, the contents of the Myfile.txt is changed (the data comes from another source for the text file). I want to now add the contents from the text file to the same table using the above code, but the error 'table already exists' appear and the operation fails. Is there a way to overcome this error and import the new values from the file.
thanks for the answers.
Senthil
September 24, 2008 at 8:36 am
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply