执行到open时出错! 
 AdoQry_Login1:=TAdoQuery.Create(Nil);
  AdoQry_Login1.Connection:=AdoQry_Login.Connection;
  StrSqlText:='Select GetDate() As ToDate';
  AdoQry_Login1.Close;
  AdoQry_Login1.Sql.clear;
  AdoQry_Login1.Sql.Add(StrSqlText);
  AdoQry_Login1.Open;

解决方案 »

  1.   

    AdoQry_Login1:=TAdoQuery.Create(Nil);
      AdoQry_Login1.Connection:=AdoQry_Login.Connection;
      if AdoQry_Login.Connection.Active = false then
        AdoQry_Login.Connection.Open;  ///********
      StrSqlText:='Select GetDate() As ToDate';
      AdoQry_Login1.Close;
      AdoQry_Login1.Sql.clear;
      AdoQry_Login1.Sql.Add(StrSqlText);
      AdoQry_Login1.Open
      

  2.   

    你的AdoQry_Login.Connection连接好了吗,有可能是你的AdoQry_Login.Connection的ConnectionString属性错误.
      

  3.   

    将StrSQLText改成如下:
    StrSqlText:='Select ToDate = GetDate()  '在最后 AdoQry_Login1.Free
      

  4.   

    AdoQry_Login1.Connection:=AdoQry_Login.Connection;
    这句话是错的吧,你可以加一个ADOConnection啊,然后
    AdoQry_Login1.Connection:=ADOconnection1;
      

  5.   


     
     可以 showmessage  一下 AdoQry_Login.Connection  看看 有没有
    如果有值 可在编译前 打开这个Connection