Software snipets for the Delphi & Pascal Community
Sep 05, 2010 - 04:49 AM
alt1
Borland :: Mailing Lists
alt1
Search  
alt1
alt1 alt1 alt1
alt1
Main Menu
alt1
· Home
· Your Account

Other Options

· AvantGo
· Downloads
· FAQ
· Members List
· Messages
· News
· Recommend Us
· Reviews
· Search
· Sections
· Stats
· Submit News
· Topics
· Top List
· Web Links

alt1
Who's online
alt1
There are currently, 7 guest(s) and 0 member(s) online.

You are an anonymous user. You can register for free by clicking here


alt1
alt1
MS-SQL : connection is in use by another statement
Posted by: Gayle
alt1
Topic ADO/OLE Database


When porting a larger database application (130k LOC) that worked fine with .linksarray[0]. and InterBase to MS-SQL (6.5), I frequently got the error message 'connection is in use by another statement'.

At first, creating a new TDatabase for each TTable/ TQuery seemed to be necessary.

Then I found what was 'wrong' (not really wrong.. :-)

To speed up some of my queries, I had set the property Unidirectional to true. Delphi creates for such queries only one cursor (versus two for bidirectional queries or TTables). After removing the assignments of Unidirectional := true the error message disappeared and everything worked fine.

The following code resulted in the exception 'connection is in use by another statement':



// dataBaseNameS : string is the name of the alias (MS-SQL 6.5)
begin
Query1 := TQuery.Create (Application);
With Query1 do
begin
DatabaseName := dataBaseNameS;
SQL.Text := 'SELECT * FROM ABLESTOP';
// the exception disappears if the following is removed
Unidirectional := True;
Open;
end;
ShowMessage ('ok')

Table1 := TTable.Create (Self);
With Table1 do
begin
DatabaseName := dataBaseNameS;
TableName := 'COMPONENT_PLAN';
UpdateMode := upWhereKeyOnly;
Open
end;

Table1.Insert;
Table1.FieldByName ('PARTNO').AsString := IntToStr (GetTickCount);
Table1.FieldByName ('ID').AsString := 'WWxx';
Table1.FieldByName ('VERSION').AsInteger := 1;
// the exception will occurr in the next statement:
// "Connection is in use by another statement"
Table1.Post;
end;


alt1
alt1
 
alt1
Login
alt1
Username

Password

Don't have an account yet? You can create one. As a registered user you have some advantages like a theme manager, comments configuration and posting comments with your name.

alt1
Related links
alt1
· More about ADO/OLE Database
· News by admin
· Oracle


Most read story in ADO/OLE Database:
MS-SQL : connection is in use by another statement


Printer friendly page  Send this story to a friend

"MS-SQL : connection is in use by another statement" | Login/Create an account | 2 Comments
Threshold
Comments are owned by the poster. We aren't responsible for their content.
Re: MS-SQL : connection is in use by another statement(Score: 0)
by Anonymous on Nov 02, 2009 - 11:10 AM
beurette suce centerblog, vedeo belle mere branleuse, 13 ans x vid os, films de culs extr, tube porn shoking, blogs et videos de femmes matures domin es, star du foot ball gays porno gratuit, free vid o porno zoophile avec femmes, account msn ragazza vogliose, vid o branlette a la plage, video gratuit baise en boite de nuit, vid o gratuite de femme se masturbent, free mobile video sex, video porno afrique, forum zoophilie feminine, mecs nus amateur, v dio x avec chevale, video incest allopass, beurette xxx forum, nudisme en famille


[ Comments not allowed for anonymous users, please register ]

Re: MS-SQL : connection is in use by another statement(Score: 0)
by Anonymous on Nov 29, 2009 - 03:52 AM
stream rocco, sexe tube 1000 teens mere baisant aves son fils, femme enculee over blog, extrais videos zoophilie chien, senior porn, www maroc youporn, zoophilies anal avec animaux, cherche femme pour raconter experience zoophilies, femme porno sex tunisie, stars porn brazzers, youpron en fran ais, jeane manson nue, keypivot, zoophilie xxx video gratuite, ragazze porche di firenze immagini, encul e , amateur porno maroc, sites recits zoophile, video zoo sexy, photos gratuites de belles femmes un peux ronde nues


[ Comments not allowed for anonymous users, please register ]

alt1
Report Bugs :: Tasks :: Developers 
alt1




alt1