如果不能连上的话,我希望自己跳出一个提示窗口,而不是程序本身出现一个
什么错误提示,请问能否实现?tks了

解决方案 »

  1.   

    with adoconnection do
    begin
    connectionstring:='...';
    try
      open;
      if not active then showmessage('a');
    except 
      showmessage('b');
    end;
    end;
      

  2.   

    try
      
    except 
      自己处理
      

  3.   

    try
      ADOConnection1.Open;
    except
      on Exception do
         showmessage('Sorry! Can not esbilished this connection!');
      

  4.   

    当然可以实现
    首先在form上选择一个控件adoconnection
    然后在formshow中写如下代码:
    try
       adoconnection1.Open;
       showmessage('open');
       except
         showmessage('close');
       end;对了,要不出现系统的提示,你还的把"tools/debug option..."打开,把general页下的
    integraged debugging 前的勾去掉
    就ok了