我使用的部分代码如下:
datapath = App.Path + "\db1.mdb"
linkdata = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + datapath + ";Persist Security Info=False" + ";Jet OLEDB:Database Password=123"sub form_load()
Adodc1.ConnectionString = linkdata
Adodc1.RecordSource = "select * from login"
Adodc1.CommandType = adCmdUnknown
Adodc1.Refresh
End sub出现了[ODBC 驱动程序管理器] 未发现数据源名称并且未指定默认驱动程序

解决方案 »

  1.   

    linkdata   =   "Provider=Microsoft.Jet.OLEDB.4.0;Data   Source= "   +   datapath   +   ";Persist   Security   Info=False "   +   ";Jet   OLEDB:Database   Password=123 " 
     改成
    linkdata="provider=Microsoft.Jet.OLEDB.4.0;Persist   Security   Info=False ;Jet OLEDB:Database   Password=123 ;Data   Source= "+app.path+"/db1.mdb"
    再试试...
      

  2.   

          ConString = "Provider = Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;" _
                    & "Data Source=" & DbName & ";Jet OLEDB:Database Password=123"      CN.ConnectionString = ConString
          CN.Open
      

  3.   

    这样呢?sub form_load() 
    datapath = App.Path & "\db1.mdb " 
    linkdata = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & datapath & ";Persist Security Info=False;Jet OLEDB:Database   Password=123"
    Adodc1.ConnectionString = linkdata 
    Adodc1.RecordSource = "select * from login " 
    Adodc1.CommandType = adCmdUnknown 
    Adodc1.Refresh 
    End sub 
      

  4.   

    Microsoft.Jet.OLEDB.4.0好像要装了.Net FrameWork才有,一般用"Driver={Microsoft Access Driver (*.mdb)};Dbq=" & App.Path & "\db1.mdb;Uid=Admin;Pwd=;"
      

  5.   

    1、检查连接字符串中的空格是否正确(象Data Source中多出空格会出现“找不到可插入的ISAM”的提示)
    2、手动生成连接字符串测试jet.OLEDB是否正常
      

  6.   

    你必须先和数据库建立一个链接,比如下面的这个mconnection,然后在用adodc来取数据
    Set Mconnection = New Connection
    MconnectionString = "Provider=SQLOLEDB.1;Password=sa;Persist Security Info=True;Initial Catalog=yinlun;User ID=sa;Data Source=."
    With Mconnection
        .ConnectionString = MconnectionString
        .Open
    End With