dbExpress “Record not found or changed by another user”

冷暖自知 提交于 2019-12-23 12:10:25

问题


How do I find the reason for a "Record not found or changed by another user" error when working with dbExpress?

How do I find the SQL statement (with the actual parameter values) that fails?


回答1:


  • make sure that the compiler uses Debug DCUs.

  • set a breakpoint in the first line of the Procedure TSQLResolver.DoExecSQL in unit db\Provider

  • run the operation which causes the error message (for example, modifying a record in a data-aware component)

  • if the debugger stops, the generated SQL command can be viewed

  • check the SQL statement for conditions which could cause the error

At this point, only constant expressions in the statement like ... 'where Field1 is null and Field2 = 0' can be checked. in DoExecSQL, the SQL statement uses placeholders (?) for parameter values, so if the constant expression conditions did not show anything helpful, continue debugging:

  • to see the actual parameter values, set a breakpoint in function TSQLConnection.Execute (in unit SqlExpr) and step through the parameter evaluation loop.


来源:https://stackoverflow.com/questions/9773147/dbexpress-record-not-found-or-changed-by-another-user

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!