views:

731

answers:

4

Hi,

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 query from within a grid (using TUpdateSQL and ApplyUpdate).

Please help~~~

Thanks a lot.

+3  A: 

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.

RRUZ
A: 

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.

No'am Newman
He's asking about TUpdateSQL component, which allow substitution of SQL generated by the BDE component(TTable, TQuery) for ones written by the developer. It's mostly used for allowing updates on queries with joins.
Fabricio Araujo
And when I say 'updates' read: insert, delete and update commands.
Fabricio Araujo
One can't insert/delete/update with a join. Only 'select' statements can have a join.
No'am Newman
We're talking about BDE components, and yes they can - if you create the SQL to Insert,Update and Delete on the query object and put it on a TUpdateSQL. When the bde component get a Post commanded, it uses the SQL on the TUpdateSQL component to write the data to database
Fabricio Araujo
A: 

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

Fabricio Araujo
+1  A: 

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

Jonathan D