I want to read a csv file into an access database , here is my code :
Private Sub load_csv()
Dim ConnectionString As String
ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;" & _
"Data Source=" & input_file & ";" & _
"Extended Properties=""Text;HDR=Yes"""
Dim TextConnection As New System.Data.OleDb.OleDbConnection(ConnectionString)
TextConnection.Open()
Dim da As New System.Data.OleDb.OleDbDataAdapter _
("SELECT * INTO [MS Access;Database=" & current_db & "].[Rapoarte] FROM [" & input_file & "]", TextConnection)
End Sub
When i run it i get an error :
'C:\Documents and Settings\username\Desktop\test.csv'
is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.
The strange thing is that the file really is there, so what else could go wrong ?