Now trying TextFileWorkspaceFactory, crashes when I open the table.
Error info:
System.Runtime.InteropServices.COMException was caught
ErrorCode=-2147220655
HelpLink="esri_csGeoDatabase.hlp"
Message=""
Source=""
StackTrace:......
Public Function OpenCSV(ByVal pReachPath As String, ByVal pTableName As String) As ITable
'textfile workspacefactory
Dim factoryType As Type = Type.GetTypeFromProgID("esriDataSourcesOleDB.TextFileWorkspaceFactory")
Dim workspaceFactory As IWorkspaceFactory = CType(Activator.CreateInstance(factoryType), IWorkspaceFactory)
' Open a directory of CSV files using its path.
Dim workspace As IWorkspace = workspaceFactory.OpenFromFile(pReachPath, 0)
' Open a CSV file as a table.
Dim featureWorkspace As IFeatureWorkspace = CType(workspace, IFeatureWorkspace)
Try
pTable = featureWorkspace.OpenTable(pTableName) 'crash here
Catch ex As Exception
MsgBox(ex.Message)
End Try
Return table
End Function