我在一个DBLookupComboBox3中显示一个表的字段,这个表保存的是其他数据库的名称等信息.当DBLookupComboBox3触发click事件时 一个 ADOConnection1 连接该数据库,一个
adoquery1 连接到 ADOConnection1上 代码如下 
var
 dbname,curdir:string;
begin
CurDir := ExtractFilePath(Application.ExeName);
dbname:=DBLookupComboBox3.Text;
with ADOConnection1 do
  begin
    ConnectionString := 'Provider = MicroSoft.jet.OLEDB.4.0;'+
                        'Persist Security Info = False'+
                        'Data Source='+curdir+dbname+'.mdb;'+
                        'Mode = ReadWrite;'+
                        'Jet OLEDB:Database Password='';';
   Connected := True;//Open DataBase
  end;
adoquery1.Connection:=ADOConnection1;
adoquery1.Open; 
end; 为什么老是调试不过去,请帮忙看一看,到底错在那了?

解决方案 »

  1.   

    'Persist Security Info = False'+
    file有没有方号?
      

  2.   

    'Persist Security Info = False;'+
      

  3.   

    错误提示: Format of the initialization string does not conform to the OLE DB 
    specifiation
    to 无聊 改后还是不行!
      

  4.   

    'Provider = MicroSoft.jet.OLEDB.4.0;'
    没有这个的驱动
      

  5.   

    不可能吧!这个驱动在 ado手工连接时的第三个呀!??
      

  6.   

    with ADOConnection1 do
      begin
        ConnectionString := 'Provider = MicroSoft.jet.OLEDB.4.0;'+
                            'Persist Security Info = False'+
                            'Data Source=D:\*.mdb;'+//数据库本地目录
                            'Mode = ReadWrite;'+
                            'Jet OLEDB:Database Password=*****;'// 加入密码
        Connected := True;//Open DataBase
      end;
      

  7.   

    到MS的网站下一MDAC安装试一下。
      

  8.   

    我看了一下,是不是ConnectionString少了一个分号?应该如下:
    ConnectionString := 'Provider = MicroSoft.jet.OLEDB.4.0;'+
                        'Persist Security Info = False;'+      //这里少了个分号
                        'Data Source='+curdir+dbname+'.mdb;'+
                        'Mode = ReadWrite;'+
                        'Jet OLEDB:Database Password='';';
      

  9.   

    Provider=Microsoft.Jet.OLEDB.4.0;Password="";Data Source=d:\rscb\zw.mdb;Mode=ReadWrite|Share Deny None;Persist Security Info=True
    心上是调试通过的代码
      

  10.   

    TO WWWWWA(aaaa)
       谢谢你了!等会我建个坛子,你进去加分!
      

  11.   

    http://218.56.11.178:8020/web/index.aspx
    ->下载基地-》例程-数据库/报表-》在DBGRID中下拉列表的显示
    仅供参考,ADO+ACCSEE写的,如果你没用过这两样东西或太菜,就不要下了,上次介绍给一位大虾,竟然看不懂!?哎,难做呀,想帮,但不一定就是帮的了。