Converting from BDE to SDAC

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
kurtbilde
Posts: 113
Joined: Wed 16 Mar 2005 16:02
Location: Odense, Denmark

Converting from BDE to SDAC

Post by kurtbilde » Sat 22 Jul 2006 11:38

Hi,

I need some advice!
I'm begining to convert an application based on Paradox (BDE). I have one DataModule the in it's OnCreate-event loads all the TTables and closes them in the OnDispose-event.
*) Is it wise to keep this aproach?
*) How do I handle the TimeOut that might occure?

*) What do you generally do with db applications? Place tables and queries on a datamodule and open them when the forms are needing them? Use queries insted of tables?

The BDE to SDAC converter is keeping the original "design", so I like to know what you are doing!

-Kurt

tinof
Posts: 39
Joined: Fri 16 Dec 2005 07:41

Post by tinof » Mon 24 Jul 2006 06:48

Hi Kurt,

i'm not really sure, if that's the *right* way, but i do so and it works :
I have one datamodule containing only the Database - Objects. Here i handle the setting of databasename / login - options and open the database(s) while application starts. If something failes the application terminates / shows a config form...
There is only one little 'Problem' : i have to check that the database objects set to disconnected each time before i release my application (while programming sometimes they get automaticly connected - but with my development db - settings - it would'nt work at customer)

All datasets are in several datamodules e.g. one with all customer tables, one with all article .... They all are using only the database objects from the main - module (so i have to handle the login - stuff only once)
I open the recordsets like you within the onCreate - event. Each of my forms creates it's 'own' datamodule - so i have no Problems with MDI - Application. If at OnCreate sth failes (timeout) you would get the error while form is loading - but because the database connection is just established (in main module) i don't have such problems. I open all tables the form needs at start and i can't see any performance problems. But there are most < 100.000 Records - if you use many tables with more records it would take a long time until the form opens. In this case it might be better e.g. to open one table for searching and the others with parameters which filter the 'detail' tables. Query only the needed fields (and not a 'SELECT *') increases performance.
I close all datasets within OnDispose()
I prefer using querys instead of tables. In query you can join 2 ore more DB-Tables within one query - i think, it's faster than using lookupfields. But if the converter converts TTables to MSTables i would make changes only in case of problems or bad performance. Tables works as well.

At least : I would say, the crLab components are a really good choice, it works safe and with very good performance. And its funny to programm with : Check DeleteWhere() Method, check the &Makro - functionallity in the SQL Statements, the tVirtualTable for temporary stuff, the DBgrid ...

Good luck !

Guest

Post by Guest » Mon 24 Jul 2006 10:14

Hi,

Just the kind of reply I was looking for!!!!!!

Thank you for your time!

all the best!
-Kurt

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Mon 24 Jul 2006 14:25

> Problem' : i have to check that the database objects set
> to disconnected each time before i release my application
If you set KeepDesignConnected option of TMyConnetion to False, your application will not try to connect when starting. Even if Connected property of TMyConnection is set to True in design time.

> In query you can join 2 ore more DB-Tables within one
> query - i think, it's faster than using lookupfields.
This is true in some cases. But as a rule usage of lookup fields decreases network traffic. Also usage of lookup fields is more preferable for editable record sets.

tinof
Posts: 39
Joined: Fri 16 Dec 2005 07:41

Post by tinof » Tue 25 Jul 2006 03:53

Hmm,
KeepDesignConnected Option - THAT'S IS IT .
Thank you very much for that advice ! Exactly what i'm looking for.
As i say - a really developer - friendly framework !

Tino

Post Reply