我的VB2005-MS Access Connection出现问题

时间:2011-03-16 12:40:58

标签: vb.net

我使用MS Access作为数据库,但错误发生在Abstract。

列中

错误讯息:

  

列'Abstract'不属于表tblBooks

这个列实际上包含在表中,但我不确定问题是否是它的DataType。(备注)

是否可以将此字段与Memo数据类型一起使用?我的代码是否有任何错误(使用我的模块)?

我的代码:

Module Module1
    Public MyConn As New OdbcConnection("Dsn=MS Access Database;dbq=D:\MyPrograms\VB.Net\Library System\dblibrary.mdb;defaultdir=D:\MyPrograms\VB.Net\Library System;driverid=25;fil=MS Access;maxbuffersize=2048;pagetimeout=5;uid=admin")
    Public MyComm As New OdbcCommand
    Public MyTable As New DataSet
    Public MyAdapt As New OdbcDataAdapter
    Public Counter As Integer

    Function Adapt(ByVal MyCommand As String, ByVal MyDataSet As String) As String
        MyAdapt = New OdbcDataAdapter(MyCommand, MyConn)
        MyAdapt.Fill(MyTable, MyDataSet)
        Return 0
    End Function
End Module



Private Sub Search()

     If cmbCategoryFilter.SelectedItem = "All" Then
        Adapt("select * from tblBooks", "tblBooks")
        txtISBNInfo.Text = MyTable.Tables(0).Rows(Counter)("ISBN").ToString
        txtTitleInfo.Text = MyTable.Tables(0).Rows(Counter)("Title").ToString
        txtAuthorInfo.Text = MyTable.Tables(0).Rows(Counter)("Author").ToString
        txtAbstractInfo.Text = MyTable.Tables(0).Rows(Counter)("Abstract").ToString
     End If

End Sub

0 个答案:

没有答案