 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Predrag Cabarkapa Guest
|
Posted: Mon Jun 27, 2005 7:01 pm Post subject: Migrating from BDE to ADO |
|
|
Hi,
I need to migrate a monster database app. from BDE to ADO.
Is there any "How to .." .
Any experience ?.
thank's
|
|
| Back to top |
|
 |
Alfred ten Hoeve Guest
|
Posted: Tue Jun 28, 2005 12:36 am Post subject: Re: Migrating from BDE to ADO |
|
|
| Quote: | I need to migrate a monster database app. from BDE to ADO.
Is there any "How to .." .
Any experience ?.
|
No experience, but here is what I would do.
1. Group all datasets into one or more datamodules.
2. If there is no TDatabase in the main Datamodule, I would begin to drop
one to it and link all tables and queries to the TDatabase.
3. Drop a TADOConnection into the main datamodule and connect it to the
database.
4. Read the DFM-files as text and do a search-Replace to change all TTables
to TADOTables. The same for queries and stored procedures. Set all
DataBase-properties to the ADOConnection.
5. Set the Dataset-property for all dataSource-components to the desired
ADODataset.
6. Compile and cleanup the mess.
If your datasets are not logicly grouped in datamodules, you have a lot of
work to do.
Hope this get you started.
Alfred.
|
|
| Back to top |
|
 |
Kevin Frevert Guest
|
Posted: Tue Jun 28, 2005 12:19 pm Post subject: Re: Migrating from BDE to ADO |
|
|
"Alfred ten Hoeve" <Alfred.nospam (AT) nospam (DOT) nl> wrote
| Quote: | I need to migrate a monster database app. from BDE to ADO.
Is there any "How to .." .
Any experience ?.
No experience, but here is what I would do.
1. Group all datasets into one or more datamodules.
|
I agree
| Quote: | 2. If there is no TDatabase in the main Datamodule, I would begin to drop
one to it and link all tables and queries to the TDatabase.
|
Since he wants to get away from the BDE, don't use any of the BDE based
components (TDatabase, TQuery, etc)
| Quote: | 3. Drop a TADOConnection into the main datamodule and connect it to the
database.
|
I agree.
| Quote: | 4. Read the DFM-files as text and do a search-Replace to change all
TTables
to TADOTables. The same for queries and stored procedures. Set all
DataBase-properties to the ADOConnection.
|
Don't use table based components against a set-based RDBMS
http://bdn.borland.com/article/0,1410,28160,00.html
http://www.logicfundamentals.com/pages/BrowsingLargeTables.aspx
http://www.logicfundamentals.com/pages/TablesVsQueries.aspx
You should be able to replace (in the DFM file) all TQuery/TStoredProc with
TADOQuery/TADOStoredProc with little or no code (PAS file) changes. For any
new development, use TADODataSet/TADOCommand. They are 'closer' to the ADO
layer than TADOQuery/TADOStoredProc.
Also, remove DBTables refrences from the 'uses' clause.
| Quote: | 5. Set the Dataset-property for all dataSource-components to the desired
ADODataset.
|
Yep
| Quote: | 6. Compile and cleanup the mess.
|
Prayer doesn't hurt either :)
| Quote: | If your datasets are not logicly grouped in datamodules, you have a lot of
work to do.
|
Yes, a lot of work. You can still logically put datasets on all your forms,
but I've rarely seen it work on large projects (I've had to fix my fair
share of them :)
Here are some additional resources of information...
http://community.borland.com/article/0,1410,22571,00.html
http://community.borland.com/article/0,1410,20847,00.html
http://www.hower.org/Kudzu/Articles/DBDesign/index.html
http://bdn.borland.com/article/0,1410,27790,00.html
Good luck,
krf
|
|
| Back to top |
|
 |
Jon Purvis Guest
|
Posted: Tue Jun 28, 2005 3:20 pm Post subject: Re: Migrating from BDE to ADO |
|
|
Predrag Cabarkapa wrote:
| Quote: | Hi,
I need to migrate a monster database app. from BDE to ADO.
Is there any "How to .." .
Any experience ?.
|
See the other posts as well. I used GReplace (http://www.obsof.com/public/download.html) to replace
all TTable and TQuery references in the .pas and .dfm files. Slick and easy - works likes a charm.
With this it didn't matter how many forms I had references on as you can tell it to search through a
directory. The biggest problem I had was switching my many Table.Find commands to Table.Locate or
Table.Lookup. Also, there's no BatchMove component for ADO, so you may need to recode that in some way.
|
|
| Back to top |
|
 |
Alfred ten Hoeve Guest
|
Posted: Tue Jun 28, 2005 3:22 pm Post subject: Re: Migrating from BDE to ADO |
|
|
| Quote: | 2. If there is no TDatabase in the main Datamodule, I would begin to drop
one to it and link all tables and queries to the TDatabase.
Since he wants to get away from the BDE, don't use any of the BDE based
components (TDatabase, TQuery, etc)
|
Before you modify anything to ADO, you must get your original code
cleanedup.
You must get it working in the first place. Then you can get into optimizing
your app.
| Quote: | Also, remove DBTables refrences from the 'uses' clause.
|
Yes!
| Quote: | 6. Compile and cleanup the mess.
Prayer doesn't hurt either
|
I can't see how that could help.
Alfred.
|
|
| Back to top |
|
 |
Kevin Frevert Guest
|
Posted: Tue Jun 28, 2005 4:19 pm Post subject: Re: Migrating from BDE to ADO |
|
|
"Alfred ten Hoeve" <Alfred.nospam (AT) nospam (DOT) nl> wrote
| Quote: | 2. If there is no TDatabase in the main Datamodule, I would begin to
drop
one to it and link all tables and queries to the TDatabase.
Since he wants to get away from the BDE, don't use any of the BDE based
components (TDatabase, TQuery, etc)
Before you modify anything to ADO, you must get your original code
cleanedup.
|
Why would anyone migrating from BDE to ADO (and not using TDatabase already)
add a TDatabase just to delete it later? I don't consider that 'cleaned
up'.
| Quote: | You should be able to replace (in the DFM file) all TQuery/TStoredProc
with
TADOQuery/TADOStoredProc with little or no code (PAS file) changes. For
any
new development, use TADODataSet/TADOCommand. They are 'closer' to the
ADO
layer than TADOQuery/TADOStoredProc.
You must get it working in the first place. Then you can get into
optimizing
your app.
|
That's why I wrote 'For any new development'. For existing BDE apps
migrating to ADO, TADOQuery and TADOStoredProc work just fine.
| Quote: | Prayer doesn't hurt either :)
I can't see how that could help.
|
Making mass changes to (for example) a 300,000+ line project needs all the
help it can get :)
krf
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|