Hi
I would appreciate any assistance with the above.
I am use to VBA in Access which is a 1 line code - docmd.tranfertext... to import information into an access database.
I am working with
VB in ASP.net. I am new to this environment.
I already have a table tblcurrency. I want to update my table with text file C:\Textfile.txt
I will change the paths later - just want the code to work first
The error is:
Syntax error in INSERT INTO statement.
My code is:
Dim cnn As OleDbConnection
Dim strSQL As String
Dim Debug As Diagnostics.Debug
cnn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source = c:\Inetpub\wwwroot\TestDB\DB\Bonus.mdb")
cnn.Open()
strSQL = "INSERT INTO [TblCurrency] (Country, Year) SELECT F1, F2 FROM[Text;HDR=NO;DATABASE=C:\;].[test.txt]"
Dim objCommand As New System.Data.OleDb.OleDbCommand(strSQL, cnn)
objCommand.CommandText = strSQL
objCommand.ExecuteNonQuery()
cnn.Close()
Thx