javromara03 de Diciembre del 2003
PreguntaEn un componente de acceso a bases de datos para un proyecto ASP se produce el siguiente error:
Transaction cannot have multiple recordsets with this cursor type. Change the cursor type, commit the transaction, or close one of the recordsets.
El código es el siguiente:
mconAdoConex.BeginTrans
Dim ArraySql() As String
ArraySql = Split(Sql, "*")
For intContador = 0 To UBound(ArraySql)
If Len(Trim(ArraySql(intContador))) > 0 Then
' mconAdoConex.BeginTrans
' Fijamos los parámetros del Command y Recuperamos el Recordset
With mcmdAdoConsulta
.CommandText = ArraySql(intContador)
.CommandTimeout = 20
.CommandType = adCmdText
Set .ActiveConnection = mconAdoConex
End With
' mrstAdoConsulta.Open mcmdAdoConsulta, , adOpenDynamic, adLockReadOnly
mrstAdoConsulta.Open mcmdAdoConsulta, , adOpenDynamic, adLockOptimistic
' mconAdoConex.CommitTrans
End If
Next intContador
mconAdoConex.CommitTrans
Alguien puede indicarme como solucionarlo.
Transaction cannot have multiple recordsets with this cursor type. Change the cursor type, commit the transaction, or close one of the recordsets.
El código es el siguiente:
mconAdoConex.BeginTrans
Dim ArraySql() As String
ArraySql = Split(Sql, "*")
For intContador = 0 To UBound(ArraySql)
If Len(Trim(ArraySql(intContador))) > 0 Then
' mconAdoConex.BeginTrans
' Fijamos los parámetros del Command y Recuperamos el Recordset
With mcmdAdoConsulta
.CommandText = ArraySql(intContador)
.CommandTimeout = 20
.CommandType = adCmdText
Set .ActiveConnection = mconAdoConex
End With
' mrstAdoConsulta.Open mcmdAdoConsulta, , adOpenDynamic, adLockReadOnly
mrstAdoConsulta.Open mcmdAdoConsulta, , adOpenDynamic, adLockOptimistic
' mconAdoConex.CommitTrans
End If
Next intContador
mconAdoConex.CommitTrans
Alguien puede indicarme como solucionarlo.
