我先用ADOCONNECTION连接好了ACCESS数据库
  CONNECTIONSTRING:=Provider=Microsoft.Jet.OLEDB.4.0;Data Source='+bufnowfolder+'\'+'年度帐本备份.mdb'+';Persist Security Info=False
  程序执行时,先删除ACCESS表中的数据
  但执行到此处时,就报错,提示authentication failed
  这是什么原因?
  该怎么改呢在线等待!!!

解决方案 »

  1.   

    CONNECTIONSTRING:='Provider=Microsoft.Jet.OLEDB.4.0;Data Source='+bufnowfolder+'\年度帐本备份.mdb'+';Persist Security Info=False'把删除的那段程序拿上来看看.
      

  2.   

    以下是我删除ACCESS数据表中记录的程序:
    //删除旧数据
      sqlstr:='delete chargeinfo where countyear='''+countyear.Text +'''';
      showmessage(sqlstr);
      with datam.accesssql do
      begin
        close;
        sql.Clear;
        sql.Add(sqlstr);
        execsql;
      end;  sqlstr:='delete chargedetail where countyear='''+countyear.Text +'''';
      with datam.accesssql do
      begin
        close;
        sql.Clear;
        sql.Add(sqlstr);
        execsql;
      end;  sqlstr:='delete chargefpinfo where countyear='''+countyear.Text +'''';
      with datam.accesssql do
      begin
        close;
        sql.Clear;
        sql.Add(sqlstr);
        execsql;
      end;
    等待中!!!
      

  3.   

    说明:其中datam.accesssql 是一个ADOQuery,它的CONNECTION属性正连接着一个ADOCONNECTION(上面已经提到过),
      

  4.   

    sqlstr:='delete from chargeinfo where countyear='''+countyear.Text +'''';//加From再试试看,应该没问题了.
      

  5.   

    还是提示authentication failed
    是我的ACCESS有问题吗?我也没有设置过它的访问权限呀