Re: TDataBase and TQuary



Anton wrote:


1. Create a TDatabase
2. Set its DatabaseName to my DB's Alias (as in BDE)
3. Call the Open method

I would suggest using TDatabase that you already have on a Form during
design time. This way there is less possibilities to do beginner
mistakes.

Ensure that TDatabase has Active = False before the last compilation.

Then at run-time set the Path for TDatabase in Form's OnCreate event, or
in some other early event. Then turn TDatabase.Active = True.

4. Create a TQuery
5. Set its DatabaseName to that of TDatabase
6. Use it.

I would suggest using design time created TQuery also, that points to
the TDatabase already on design time, so you do not need to re-set
anything to TQuery, just open it. All this is again just to minimize
possible beginner mistakes.

When you get these two phases working, there is quite an easy step to
jump to those at run-time created TDatabase and TQuery. If you for some
reason have excessive need for that.
DB-1
.



Relevant Pages

  • TDataBase and TQuary
    ... Can you help me with setting up a TDatabase so that it would allow to ... explicitly control a DB connection instead of using the TDatabase that's ... Set its DatabaseName to my DB's Alias ... the TQuery continues working happily... ...
    (comp.lang.pascal.delphi.misc)
  • Re: Using TQuery and ODBC with a database password
    ... It took me awhile to get the TQuery to connect to ... the TDataBase but that is exactly what I was looking for. ... I currently have a FileMaker Pro database which I am connecting to from ... The connection works fine using a TQuery (and optionally a ...
    (comp.lang.pascal.delphi.databases)
  • Re: TDataBase and TQuary
    ... Create a TDatabase ... Set its DatabaseName to my DB's Alias ... can you query for new ones? ... and make the query switch to it? ...
    (comp.lang.pascal.delphi.misc)
  • Re: MS SQL: Temporary table resource limit
    ... I have a TDataBase and a TQuery in a thread, reading more than 3 ... it uses all memory available... ...
    (alt.comp.lang.borland-delphi)
  • BDE -> ADO
    ... My application containes one TDatabase, hundreds of TTable and TQuery, now I ... want to switch to ADO, I know TDatabase is similar with TADOConnection, and ... My question is if I can just replace them with ADO components. ...
    (borland.public.delphi.database.ado)