code to open CSV in 10.0 does not work in 10.1

Discussion created by TW_WebMap on Dec 10, 2012
Latest reply on Dec 10, 2012 by TW_WebMap
My code for 10.0, which returns ITable, does not work in 10.1.  I've read that 10.1 has a new method for opening text files, but I can't find any details. Anyone solve this problem? Thanks!

Dim pTable As ITable = Nothing
Dim pMxDoc As IMxDocument = My.ArcMap.Document
Dim pMap As IMap = pMxDoc.FocusMap
Dim factoryType As Type = Type.GetTypeFromProgID("esriDataSourcesOleDB.TextFileWorkspaceFactory")

'last line in 10.1, exits the function here.
Dim workspaceFactory As ESRI.ArcGIS.Geodatabase.IWorkspaceFactory2 = CType(Activator.CreateInstance(factoryType),IWorkspaceFactory2)

Dim workspace As IWorkspace = workspaceFactory.OpenFromFile(pReachPath, 0)
Dim featureWorkspace As IFeatureWorkspace = CType(workspace, IFeatureWorkspace)
                pTable = featureWorkspace.OpenTable(pTableName)
            Catch ex As System.Exception
                Return Nothing
            End Try