I'm using the following function to extract data from a CSV file:
Class CSVReader
Public Function GetDataTable(strFileName As String) As System.Data.DataTable
Dim conn As New System.Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0; Data Source = " + System.IO.Path.GetDirectoryName(strFileName) + "; Extended Properties = ""Text;HDR=YES;FMT=Delimited""")
conn.Open()
Dim strQuery As String = "SELECT * FROM [" + System.IO.Path.GetFileName(strFileName) + "]"
Dim adapter As New System.Data.OleDb.OleDbDataAdapter(strQuery, conn)
Dim ds As New System.Data.DataSet("CSV File")
adapter.Fill(ds)
Return ds.Tables(0)
End Function
End Class
This is working fine locally, however I've transferred the code to our development server and I'm getting the following error:
The 'Microsoft.Jet.OleDb.4.0' provider is not registered on the local machine.
I've checked the version on the server, and its 4.0.9756.0
Why am I getting this error?