zoukankan      html  css  js  c++  java
  • Using X++ Code force Synchronisation DataBase

    wrote by Jimmy on DEC 27th 2010

    //Synchronisation Error: Cannot execute a data definition language command on ()
    static void Jimmy_DbSynchronizeForce(Args _args)
    {    
        Dictionary              dict;
        int                     idx, lastIdx, totalTables;
        TableId                 tableId;
        Application             application;
        SysOperationProgress    progress;
        StackBase               errorStack;
        ErrorTxt                errorTxt;
        ;
        application = new Application();
        dict        = new Dictionary();
        totalTables = dict.tableCnt();
        progress    = new SysOperationProgress();
        progress.setTotal(totalTables);
        progress.setCaption("@SYS90206");
        errorStack = new StackBase(Types::String);
        lastIdx = 0;
        try
        {
            for (idx = lastIdx+1; idx <= totalTables; idx++)
            {
                tableId = dict.tableCnt2Id(idx);
                progress.setText(strfmt("%1 - completed %2",dict.tableName(tableId),idx / totalTables * 100));
                lastIdx = idx;
                application.dbSynchronize(tableId, false, true, false);
                progress.incCount();
            }
        }
        catch (Exception::Error)
        {
             errorTxt = strFmt("Error in table '%1' (%2)", tableId, dict.tableName(tableId));
             errorStack.push(errorTxt);
             retry;
        }
        setPrefix("@SYS86407");
        errorTxt = errorStack.pop();
        while (errorTxt)
        {
            error(errorTxt);
            errorTxt = errorStack.pop();
        }
    }
    
  • 相关阅读:
    模拟测试69
    模拟测试68
    模拟测试66
    NOIP模拟测试15
    NOIP模拟测试14
    Gekoo's checker
    NOIP模拟测试13
    替罪羊树模板
    KDTree笔记
    NOIP模拟测试12
  • 原文地址:https://www.cnblogs.com/Fandyx/p/1918119.html
Copyright © 2011-2022 走看看