OleDB使用较少的查询访问Access mdb

时间:2018-08-31 16:27:40

标签: vb.net ms-access oledb

我的来源如下:

    Dim Connection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=datenbank.mdb")
    Connection.open()
    Dim queryString As String
    Dim DBreader As OleDbDataReader
    queryString = "SELECT * FROM datenbank"
    Dim command As New OleDbCommand(queryString, Connection)
 DBreader = command.ExecuteReader()
    Try
        While (DBreader.Read())
            MsgBox(DBreader("0").ToString() & ", " & DBreader("1").ToString() & ", " & DBreader("2").ToString() & ", " & DBreader("3").ToString() & ", " & DBreader("4").ToString())
        End While
        DBreader.Close()

        Connection.close()
    Catch ex As Exception
        MsgBox(ex.Message)
    End Try

我得到了正确的列数,但查询中没有记录。

这是怎么了?

0 个答案:

没有答案