最近,用Delphi 2007 for .net 开发一个asp.net项目,这两天在解析xml时,发现在设置断点进行调试时出现以下问题: 1、无法跟踪变量,Watch窗口中的变量值一栏中显示(compiler error): symbol is not linked in executable 2、单步调试时,不是每一行代码都执行,在没有任何条件判断和分支的情况下,有些代码行被条过去了。
// 找出修改和删除的记录 for I := 0 to rows.Count - 1 do // 执行 begin OrgID := rows[i].Item['deptid'].ToString; Org := vRemoteOrgan.SelectSingleNode('//org[@OrgID=''' + OrgID + ''']');
strSQL := ''; // 执行 strTMP := ''; // 执行
if (Org = nil) then // 执行 begin strSQL := 'update STA_DEPARTMENT t set t.delflag = ''1'' where t.DeptID = ''' + OrgID + ''''; // 执行 end else begin //如果有字段值不同 //比较组织名称 OrgAttr := Org.SelectSingleNode('//OrgName'); if (OrgAttr.Value = rows[i].Item[1].ToString) then begin strTMP := 't.DeptName = ''' + OrgAttr.Value + ''''; end; JoinString(strSQL, strTMP);
//比较组织类型 OrgAttr := Org.SelectSingleNode('//OrgType'); if (OrgAttr.Value = rows[i].Item[1].ToString) then begin strTMP := 't.DeptType = ''' + OrgAttr.Value + ''''; end; JoinString(strSQL, strTMP);
//..... 比较其他字段
if strSQL <> '' then begin strSQL := 'update STA_DEPARTMENT t set ' + strSQL + ', t.syncDate = to_char(sysdate, ''yyyymmdd'') where t.DeptID = ''' + OrgID + ''''; // 执行 end; end;
if strSQL <> '' then dm.ExecuteNonQuery(strSQL, err); // 执行 end; finally vData.Free; // 执行 end; end;