注册 登录
编程论坛 VB.NET论坛

找错

ccc111 发布于 2008-01-11 14:38, 965 次点击
找错
Dim mydb As DAO.Database
    Dim myws As DAO.Workspace
    Dim mysql As String
    Dim myrec As DAO.RecordsetTypeEnum
    Friend WithEvents btsearchbooks As System.Windows.Forms.Button
    Friend WithEvents TxtsearchNumbers As System.windows.forms.TextBox

    Dim de As DAO.DBEngine = New DAO.DBEngine
    Public Function openDb() As Short
        Dim dbstr As String
        dbstr = "c:\lib.mdb"
        myws = de.Workspaces(0)
        mydb = myws.OpenDatabase(dbstr, False, False)
        dbstr = "select * from tblstudents"
        myrec = mydb.OpenRecordset(dbstr, DAO.RecordsetTypeEnum.dbOpenDynaset)
    End Function

请问这一段有什么错误,谢谢
1 回复
#2
qlong07282008-01-12 09:36
在NET链接MDB数据库用OleDb,链接SQL数据库用SqlClient
1