Board index » delphi » Problem using ttable with SQLServer

Problem using ttable with SQLServer

I'm with problem with ttable using SQL Server 6.5 Small Business ( user
connection limited in 25).
Each ttable open one connection with the server.
The problem's that number of connection increase until limited, locking the
SQL Server
in the Server, and my application in the client.
And with tquery this problem don't occur.

Have I use tquery or Has an way that can used ttable and user connection
don't increase ?

Perfil C&S

PS: Sorry my English is very bad.

 

Re:Problem using ttable with SQLServer


try to use a TDatabase component and connect all your ttables and
queries to it

Ate logo

Quote
PERFIL C&S wrote:

> I'm with problem with ttable using SQL Server 6.5 Small Business ( user
> connection limited in 25).
> Each ttable open one connection with the server.
> The problem's that number of connection increase until limited, locking the
> SQL Server
> in the Server, and my application in the client.
> And with tquery this problem don't occur.

> Have I use tquery or Has an way that can used ttable and user connection
> don't increase ?

> Perfil C&S

> PS: Sorry my English is very bad.

Re:Problem using ttable with SQLServer


I do it  and don't get sucess. The connections's number continue incresing.
Thank's.

Federico Cardenas escreveu na mensagem <37B9FB07.6D8AE...@hotmail.com>...

Quote
>try to use a TDatabase component and connect all your ttables and
>queries to it

>Ate logo

>PERFIL C&S wrote:

>> I'm with problem with ttable using SQL Server 6.5 Small Business ( user
>> connection limited in 25).
>> Each ttable open one connection with the server.
>> The problem's that number of connection increase until limited, locking
the
>> SQL Server
>> in the Server, and my application in the client.
>> And with tquery this problem don't occur.

>> Have I use tquery or Has an way that can used ttable and user connection
>> don't increase ?

>> Perfil C&S

>> PS: Sorry my English is very bad.

Re:Problem using ttable with SQLServer


In article <7pcp05$2...@forums.borland.com>, perfi...@globalsite.com.br
says...

Quote
> I'm with problem with ttable using SQL Server 6.5 Small Business ( user
> connection limited in 25).
> Each ttable open one connection with the server.
> The problem's that number of connection increase until limited, locking the
> SQL Server
> in the Server, and my application in the client.
> And with tquery this problem don't occur.

> Have I use tquery or Has an way that can used ttable and user connection
> don't increase ?

You will have to use TQuery components going to database connection if
you want to limit connections.  Our company went through the same thing.  
Can be a lot of work but it is what you have to do.

Kevin L. Bass

Re:Problem using ttable with SQLServer


Note that Sql-Server 6.5 on small business server is a few versions behind
the full Sql-Server 6.5, and does not react in the same way (and is unlikely
to be updated). I would advise that you either use the full version, or look
at SBS 4.5 with Sql-Server 7.

--
Adroit Software Ltd
------------------------------
Remove the nospam. to mail me direct

Quote
PERFIL C&S <perfi...@globalsite.com.br> wrote in message

news:7pcp05$2916@forums.borland.com...
Quote
> I'm with problem with ttable using SQL Server 6.5 Small Business ( user
> connection limited in 25).
> Each ttable open one connection with the server.
> The problem's that number of connection increase until limited, locking
the
> SQL Server
> in the Server, and my application in the client.
> And with tquery this problem don't occur.

> Have I use tquery or Has an way that can used ttable and user connection
> don't increase ?

> Perfil C&S

> PS: Sorry my English is very bad.

Re:Problem using ttable with SQLServer


Sorry, but my experience has been in ORACLE but I'm starting an SQL Server
Project....

Are we talking connections or open cursors?

I would expect a TDatabase object to limit the number of connections to ONE.
However, opening TTables and TQuerys would open cursors.  Am I mixed up on
this or is the question malformed?

Cash

Quote
PERFIL C&S <perfi...@globalsite.com.br> wrote in message

news:7pcr11$1r11@forums.borland.com...
Quote
> I do it  and don't get sucess. The connections's number continue
incresing.
> Thank's.

Re:Problem using ttable with SQLServer


Quote
PERFIL C&S wrote:

> I'm with problem with ttable using SQL Server 6.5 Small Business ( user
> connection limited in 25).
> Each ttable open one connection with the server.

As someone else stated, connecting the tables to a TDatabase component
wuld be a good
idea.

To fix the numerous connections, try setting cached updates to true and
deal with
them that way.  You may need to change your TTables to TQuery's, I don't
use
Tables much.  Even with TQuery without setting cached updates I
experience
the same problems against MS SQL Server 6.5 SP5a

Re:Problem using ttable with SQLServer


Well regardless of the connections issue, you should use TQuerys and not
TTables when working against a CS back end. Performance will suffer
otherwise...

Re:Problem using ttable with SQLServer


Absolutely use tqueries and not only that, the upgrade from SBS 4.0 (sql 6.5) to
SBS 4.5 (sql 7.0) is free from Microsoft. Best deal in town.

Craig

Quote
Brian Jones <bri...@nospam.adroit-software.co.uk> wrote in message

news:7pecft$1qq8@forums.borland.com...
Quote
> Note that Sql-Server 6.5 on small business server is a few versions behind
> the full Sql-Server 6.5, and does not react in the same way (and is unlikely
> to be updated). I would advise that you either use the full version, or look
> at SBS 4.5 with Sql-Server 7.

> --
> Adroit Software Ltd
> ------------------------------
> Remove the nospam. to mail me direct
> PERFIL C&S <perfi...@globalsite.com.br> wrote in message
> news:7pcp05$2916@forums.borland.com...
> > I'm with problem with ttable using SQL Server 6.5 Small Business ( user
> > connection limited in 25).
> > Each ttable open one connection with the server.
> > The problem's that number of connection increase until limited, locking
> the
> > SQL Server
> > in the Server, and my application in the client.
> > And with tquery this problem don't occur.

> > Have I use tquery or Has an way that can used ttable and user connection
> > don't increase ?

> > Perfil C&S

> > PS: Sorry my English is very bad.

Re:Problem using ttable with SQLServer


I had this problem a week ago with a 10 licence SBS, I managed to get 17
connections... and both SQL Server and my App locked!

Use TQuerys instead of TTables is simple as that... It'll give you just one
connection :-)
All TQuerys should be like "select * from xxx"

If you use Lookup combos and other stuff, their datasource should point to
other TQuerys.

The TTable component is usefull for file based databases (like db, paradox
and access)

One warning: Set the "Request Live" property to true.

Other warning: use ONE TDatabase component and set all DB component's
Session Name do "Default".

And another one: If you create and use any hard-coded TQuerys, make sure you
use them BEFORE setting any other TQuery.Active to true. If you don't,
you'll end up with 2 connections!!! One for the components created at design
time, and the other for the query you've just created.

If you just use those run-time querys only after every other component (DB
of cource) is created, then make a dummy sql and execute it, like usually
do:
myQuery.SQL.Add('select null');
myQuery.Execute;

That's what I did and it really worked

hope it helps,
CH3

Quote
PERFIL C&S <perfi...@globalsite.com.br> wrote in message

news:7pcp05$2916@forums.borland.com...
Quote
> I'm with problem with ttable using SQL Server 6.5 Small Business ( user
> connection limited in 25).
> Each ttable open one connection with the server.
> The problem's that number of connection increase until limited, locking
the
> SQL Server
> in the Server, and my application in the client.
> And with tquery this problem don't occur.

> Have I use tquery or Has an way that can used ttable and user connection
> don't increase ?

> Perfil C&S

> PS: Sorry my English is very bad.

Re:Problem using ttable with SQLServer


WRONG! WRONG! WRONG! WRONG! WRONG! WRONG! WRONG! WRONG!

I made a mistake with this:

"And another one: If you create and use any hard-coded TQuerys, make sure
you
use them BEFORE setting any other TQuery.Active to true. If you don't,
you'll end up with 2 connections!!! One for the components created at design
time, and the other for the query you've just created."

Instead of BEFORE it should be AFTER!!!

This is why: If you run any SQL statement before the connection is open
through one of the TQuerys, you'll get the 2nd connection opened...

you should open the smallest (recordcount) query you have, just after
opening the TDatabase.

Sorry,
CH3

Other Threads