Board index » delphi » Fetching rows from MS SQL

Fetching rows from MS SQL

Hello,
I have strange problem, which I think, relates to BDE (or MS SQL BDE link).
If I open a query, BDE fetches first record form the server. Then I open
another query and BDE fetches all records from first query. Why???
If I use Oracle BDE link, it behaves OK.

(BDE 5.11, MSSQL 7, Delphi 4)
Please, could you help me, how to solve this problem?

Thank You.

Michal Motalik

 

Re:Fetching rows from MS SQL


Quote
Michal Motalik wrote in message <3a4c8b2...@news.cvut.cz>...
>I have strange problem, which I think, relates to BDE (or MS SQL BDE
link).
>If I open a query, BDE fetches first record form the server. Then I
open
>another query and BDE fetches all records from first query. Why???
>If I use Oracle BDE link, it behaves OK.

This is a standard issue with MSSQL. The BDE uses DBLIB (from MS) to
talk to MSSQL and there can only be one open query in a connection. So
when you open a second query, all the records from the first query must
be fetched and cached so it can be closed.

The soliution is to use multiple connections (TDatabase components) or
use ADO components.

--
Wayne Niddery (WinWright Inc.)
RADBooks - http://members.home.net/wniddery/
"As someone who has worked both in private industry and in academia,
whenever I hear about academics wanting to teach ethics to people in
business, I want to puke." - Thomas Sowell

Re:Fetching rows from MS SQL


Go with ADO, its fast and reliable.
Quote
Michal Motalik wrote in message <3a4c8b2...@news.cvut.cz>...
>Hello,
>I have strange problem, which I think, relates to BDE (or MS SQL BDE link).
>If I open a query, BDE fetches first record form the server. Then I open
>another query and BDE fetches all records from first query. Why???
>If I use Oracle BDE link, it behaves OK.

>(BDE 5.11, MSSQL 7, Delphi 4)

>Please, could you help me, how to solve this problem?

>Thank You.

>Michal Motalik

Re:Fetching rows from MS SQL


Go for Ado. I fought with that problem for a long time. I found the only way
to get it working properly was to use different Tdatabase components for
each query. Not pretty ... Use Ado, it is fast, quite realiable and has
several nice features you won't have with bde.

"Michal Motalik" <mota...@cross.cz> a crit dans le message news:
3a4c8b2...@news.cvut.cz...

Quote
> Hello,
> I have strange problem, which I think, relates to BDE (or MS SQL BDE
link).
> If I open a query, BDE fetches first record form the server. Then I open
> another query and BDE fetches all records from first query. Why???
> If I use Oracle BDE link, it behaves OK.

> (BDE 5.11, MSSQL 7, Delphi 4)
> Please, could you help me, how to solve this problem?

> Thank You.

> Michal Motalik

Other Threads