运行:
Set db = OpenDatabase(App.Path + "\data\data.mdb")
时遇到Run-time error 3343!!
警告说:Unrecognized database format "c:\data.mdb"!!
是什么原因????

解决方案 »

  1.   

    建议用ADO
    Dim adoCnn As New adodb.Connection
     Dim adoCmm As New adodb.Command
     Dim adoRec As New adodb.Recordset
     
     adoCnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Program Files\Microsoft Visual Studio\VB98\NWIND.MDB;Persist Security Info=False"
     
     adoCmm.ActiveConnection = adoCnn
     adoCmm.CommandType = adCmdText
     adoCmm.CommandText = "select * from Customers"
     Set adoRec = adoCmm.Execute
     Set MSHFlexGrid1.DataSource = adoRec
      

  2.   

    你的错误原因是不可识别的数据库格式。你要引用更高版本的数据库引擎。引用Microsoft.Jet.OLEDB.4.0就可以解决了。楼上给出了示例。你可以参考一下。
      

  3.   

    引用ADO,
       Dim adoCnn As New adodb.Connection
       Dim adoRec As New adodb.Recordset
      adoCnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Program Files\Microsoft Visual Studio\VB98\NWIND.MDB;Persist Security Info=False"
    ''''OK.