Snackmoore
Snackmoore

Reputation: 935

Equivalent to TUpdateSQL in Delphi 2010 dbExpress?

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

I have a lot of codes updating readonly query from within a grid (using TUpdateSQL and ApplyUpdate).

Please help~~~

Thanks a lot.

Upvotes: 4

Views: 2404

Answers (4)

Jonathan D
Jonathan D

Reputation: 1364

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

Upvotes: 1

Fabricio Araujo
Fabricio Araujo

Reputation: 3820

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....

Upvotes: 0

No'am Newman
No'am Newman

Reputation: 6477

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.

Upvotes: 0

RRUZ
RRUZ

Reputation: 136401

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

You can read these articles

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.

Upvotes: 3

Related Questions