SqlServer Nested Fetch Error

General discussion forum about all databases other than SqlBase.
MPARISI

SqlServer Nested Fetch Error

Post by MPARISI » 05 Mar 2012, 09:50

I have a problem using TD6.0 with SQLSERVER database (both 2000/2005 versions) and OLEDB connection.
Using code like this:
Call SqlPrepareAndExecute(hSql1, sSql1)
While SqlFetchNext(hSql1, nlfr1)
Call SqlPrepareAndExecute(hSql2, sSql2)
TD6.0 crash (executing hSql2 query) with next message: "Impossibile creare una nuova connessione perché è attiva la modalità di transazione manuale o automatica.",
which means "Unable to create new connection because the transaction mode is activated manually or automatically."

I get this error only when the first query (hSql1) finds more than one record.
The same code works perfectly with TD4.1;
My connect string in sql.ini is:
ConnectString="Provider=sqloledb;Data Source=192.168.0.29\SQLEXPRESS;Initial Catalog=[database];Integrated Security=SSPI"
Is it a TD6.0 issue or I made something wrong?
Thanks,
Mauro Parisi

FRBhote
India
Posts: 2206
Joined: 09 Mar 2017, 05:32
Location: Hyderabad, India

Re: SqlServer Nested Fetch Error

Post by FRBhote » 05 Mar 2012, 13:37

Are you sure it worked earlier? Otherwise I would blame the Connection Busy message which is due to MARS.

MPARISI

Re: SqlServer Nested Fetch Error

Post by MPARISI » 05 Mar 2012, 14:07

Yes I am sure.
I am migrating an application from version 4.1 to 6.0
Excuse me but what does MARS mean?

Thanks
Mauro

Georg Diczig
Germany
Posts: 175
Joined: 15 Mar 2017, 15:15
Location: Cologne Germany

Re: SqlServer Nested Fetch Error

Post by Georg Diczig » 05 Mar 2012, 15:21

MARS - Multiple Active Result Sets
http://msdn.microsoft.com/en-us/library/ms131686.aspx

Try to set SqlResultSet = TRUE befor your first connection.

Wich version of SqlServer / driver you are using? For the native client driver you habe to enable it over your connectionstring:
In addition, a new connection string keyword, Mars_Connection, as been added. It accepts "yes" or "no" values; "no" is the default.
Regards
Georg
Best Regards
Georg Diczig

MPARISI

Re: SqlServer Nested Fetch Error

Post by MPARISI » 06 Mar 2012, 09:43

Setting SqlResultSet = TRUE before my first connection the problem no longer occurs.
Thanks to all

Return to “General Discussion”

Who is online

Users browsing this forum: [Ccbot] and 1 guest