开发者

Equivalent to TUpdateSQL in Delphi 2010 dbExpress?

I am planning to migrate a Delphi 6 BDE application to Delphi 2010...

  • First of all, do I have to move away from BDE? (I will but I prefer to do this in stages if possible)

  • Second, is dbExpress the best choice? (I am using MS SQL)

  • Lastly, is there an equivalent of TUpdateSQL in dbExpress? (or anything else)

I have a lot of codes updating readonly quer开发者_JAVA技巧y from within a grid (using TUpdateSQL and ApplyUpdate).

Please help~~~

Thanks a lot.


1) You definitely have to migrate from BDE to DbExpress. BDE is an obsolete and deprecated technology.

You can read these articles

  • Migrating BDE Applications to dbExpress
  • Migrating Data from TDataSet to SQL DBMS

2) DbExpress is a better alternative than BDE to communicate with sql server, however I prefer ADO because is native for SQL Server.

3) dbExpress has no component similar to TUpdateSQL, however Luxene have a TDBXUpdateSQL wich is part from dbExpress eXtension components.

You can check also InstantBDExpress (is a component library that enables seamless migration of old BDE applications to the dbExpress technology) from ETHEA

Bye.


On a TDataSetProvider there is a event called BeforeUpdateRecord which is basicly a more manual way of doing TUpdateSQL

you have to create the SQL your self and then update it.(via TADOQuery etc..)

how ever it has the same basics of old and new values which where in TUpdateSQL

sry this is c++ i don't know dehpli but it basicly the same i think

DeltaDS->FieldByName("id")->NewValue;

and

DeltaDS->FieldByName("id")->OldValue;

also you have to set

Applied = true;

so that it doesn't try to do the update after you have manually done it

here a few links which should help About BeforeUpdateRecord

if you need any more info just add a comment and ill get back to you


Using the SQLQuery component of dbExpress, one can write 'queries' such as

update <table>
set value = :v1
where something = :v2

and then one calls the 'execsql' method to physically update the table.


Using ClientDatasets and providers, you can use a TDatasetProvider with a generic OnUpdateRecord(?, don't remember the exact name now) handler and make it uses the sqls you used on TUpdateSQL.

Just an idea, in the case you cannot use 3rd party components....

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜