Board index » off-topic » TTable.Open works too much...

TTable.Open works too much...


2007-02-28 07:02:16 PM
off-topic10
When the method Open from a TTable is invoked some queries are executed. For
example this one:
select c.name, c.status, o.name
from syscolumns c, sysobjects o
where c.id = object_id ('dbo.TableName') and c.cdefault *= o.id
order by colid ASC
Who is generating these queries?
I'm interested in replacing the "*=" by a standart join
Delphi 7, BDE 5.01, SQLServer 2000
Thanks
Manolo
 
 

Re:TTable.Open works too much...

If you want to write the SQL use a TQuery, not a TTable. You should
never use TTable with a SQL database server unless you want poor
performance. You should not use the BDE for any new development since
development of the BDE was stopped years ago and the SQL Links drivers
have been deprecated.
--
Bill Todd (TeamB)
 

Re:TTable.Open works too much...

I am not making a query. With the TTable the app is opening tables for
making changes into them.
Problem1: DBGrid with TQuery cannot write into the table.
Problem2: I need a lot of time to change the whole application to ADO (more
than 600,000 code lines with complex and inherited BDE controls). I haven't
got this time. I know I have to migrate and I am planning it but by the
moment I need solutions for my clients.
I am trying to rewrite the query the TTable makes for other with a standart
join. This query seems to be executed when the table has default values to
some columns. I don't know who contruct this query. The BDE internally?
Where is these code?
Thanks in advance.
"Bill Todd" < XXXX@XXXXX.COM >escribi?en el mensaje
Quote
If you want to write the SQL use a TQuery, not a TTable. You should
never use TTable with a SQL database server unless you want poor
performance. You should not use the BDE for any new development since
development of the BDE was stopped years ago and the SQL Links drivers
have been deprecated.

--
Bill Todd (TeamB)
 

{smallsort}

Re:TTable.Open works too much...

Manolo Garcma wrote:
Quote
I am not making a query. With the TTable the app is opening tables for
making changes into them.
What database are you using? If you are using a SQL database server and
the tables are very large using TTable will be slow.
Quote

Problem1: DBGrid with TQuery cannot write into the table.
That is not true. Set the RequestLive property of the TQuery to true
and you can edit the query result just like you can with a TTable.
There are some restrictions. See the RequestLive property in the help
file for details.
Quote
Problem2: I need a lot of time to change the whole application to ADO
(more than 600,000 code lines with complex and inherited BDE
controls). I haven't got this time. I know I have to migrate and I am
planning it but by the moment I need solutions for my clients.

I am trying to rewrite the query the TTable makes for other with a
standart join. This query seems to be executed when the table has
default values to some columns. I don't know who contruct this query.
The BDE internally? Where is these code?
The code that generates the the queries executed by a TTable is buried
inside the BDE. You can not change it. If you want to use a join you
must use a TQuery so you can write the SQL.
--
Bill Todd (TeamB)
 

Re:TTable.Open works too much...

Quote
>Problem1: DBGrid with TQuery cannot write into the table.

That is not true. Set the RequestLive property of the TQuery to true
and you can edit the query result just like you can with a TTable.
There are some restrictions. See the RequestLive property in the help
file for details.
Cool! Thanks. It had never fixed to me to that property.
Quote
What database are you using? If you are using a SQL database server and
the tables are very large using TTable will be slow.
The App uses TTable for small tables. This is code very old, from when the
company started to work with Delphi.
Quote
The code that generates the the queries executed by a TTable is buried
inside the BDE. You can not change it. If you want to use a join you
must use a TQuery so you can write the SQL.
OK. Thanksa lot Bill. :)
Manolo