delphi连接sql,我现在往数据库中写入记录,如果数据库连正常,则写入,如果
数据库连接出现问题,则给出提示,把记录写入本机的同样的sql数据库,以上功能
该怎样实现呀,谢谢各位大虾了

解决方案 »

  1.   


     adoconnection1.connectstring:="provider...... server=test1";
    try
    adoconnection1.open;
    except
    showmessage("wrong,connect to yourself");
    end;
    adoconnection1.connectstring:="provider...... server=yourself";
    adoconnection1.open;
      

  2.   

    adoconnection1.connectstring:="provider...... server=test1";
    try
    adoconnection1.open;
    except
    showmessage("wrong,connect to yourself");
    adoconnection1.connectstring:="provider...... server=yourself";
    adoconnection1.open;
    end;