cancel
Showing results for 
Search instead for 
Did you mean: 

ERROR 40002 TIEMPO DE EJECUCION

Former Member
0 Kudos

Hi Dears,

I am working whit Visual Basic 6 and Sybase Adaptive Server Enterprise 15.0.3, and I get the following error:

ERROR 40002 TIEMPO DE EJECUCION

HY000: [DataDirect] [ODBC Sybase wire protocol Driver] Sybase does not allow more that one active statement when  retrieving results with out a cursor

Can you help me, please!!!!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi friends.


Tis is the root cause ande the possible solutions:



The root cause:


The ODBC driver does not support transactions on a connection that has open sets of results. The result set must be opened and closed within the scope of the transaction. The ODBC driver does not preserve cursors in the transaction boundaries. This means that open result sets, but must be closed before entering or exiting the scope of a transaction. This is a limitation in the design of the ODBC driver used.

Recommended Solutions:

1. Check if there is an ODBC driver that does not have this limitation, and use it if exists.

2. Use DAO instead of RDO.

3. Rewrite the code to avoid this limitation. That is, that the result sets open but closed before entering or exiting the scope of a transaction.

It is not a backend problem, it corresponds to an error in the way you are programming, taking into account the limitations of the ODBC driver used.

Iván.

Answers (1)

Answers (1)

c_baker
Employee
Employee
0 Kudos

Sounds like you are processing results and attempting to also issue another query.

You need to finish processing the results and close the result set, before opening another query on the same connection.

As this is VB6, you may be experiencing this in an MDI interface where you have results in one MDI window and are opening another window for another query on the same connection.

Chris


Former Member
0 Kudos

Chris, a lot of thanks,

I'm going to check the source code.