none
异常 RRS feed

  • 问题

  •         Public Shared Function GetSheetNames(ByVal path As String) As ArrayList
                Dim pResult As ArrayList = New ArrayList()
                Dim connStr As String = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Extended Properties=Excel 8.0;" + "data source=" + path
                Dim strSqlSchema As String = "SELECT * FROM [{0}]"
                Dim conn As OleDbConnection = New OleDbConnection(connStr)
                conn.Open()   '异常提示:未处理OleDbException
                                     '异常快照:System.Data.OleDbException    {"无效的参数量"}
                Dim tblSchema As DataTable
                tblSchema = conn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, New Object() {Nothing, Nothing, Nothing, "TABLE"})
                Dim row As DataRow
                For Each row In tblSchema.Rows
                    pResult.Add(row("TABLE_NAME"))
                Next
                Return pResult
            End Function

    请问代码中注释的异常现象怎么解决?
    谢谢!

    2010年1月14日 7:18

答案

全部回复