I want to read the csv file in the 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 message:
'C:\Documents and Settings\username\Desktop\test.csv'
not a valid path. Make sure that the path name is correct and that you are connected to the server on which the file is located.
It’s strange that there really is a file, so what else could go wrong?
source
share