TDataBase and TQuary



Hi all,

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
created at Run Time automatically?

I did the following (all in Run Time):

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

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

But that doesn't work for some reason. If I suddenle Close the
TdataBase, the TQuery continues working happily... From which I conclude
it's not using _my_ TDatabase.

Thanks in advance,
Anton.
.



Relevant Pages

  • 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: 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)
  • Re: TDataBase and TQuary
    ... Set its DatabaseName to my DB's Alias ... Call the Open method ... I would suggest using TDatabase that you already have on a Form during ... I would suggest using design time created TQuery also, ...
    (comp.lang.pascal.delphi.misc)
  • MS SQL: Temporary table resource limit
    ... I have a TDataBase and a TQuery in a thread, reading more than 3 ... is there a good way to "flush" temporary data, ...
    (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)