ayuda con updatebacht de ado
Publicado por fernando (4 intervenciones) el 07/11/2002 18:32:02
Buenas a todos,tengo un problema con una aplicacion echa con visual 6 y atacando a una base de datos oracle 8,utilizo ado 2.5,cuando intento actualizar me dice:
-- error, -2147217887 "La operacion en varios pasos genero errores,compruebe los valores de estado".
el codigo es el siguiente:
Public Function modificar_registro(ByVal pnumoperaci As Double, ByVal pidinmov As Double) As Boolean
Dim stQuery As String
Dim rst As ADODB.Recordset
Set rst = New ADODB.Recordset
On Error GoTo err
'strQuery = "SELECT * From inmoviliza_oper where numoperaci= " & pnumoperaci & " and idinmov= " & pidinmov & " "
'Set rst = bd.OpenRecordset(strQuery, dbOpenDynaset)
If (rst.State <> adStateClosed) Then
rst.Close
End If
If (rst.State = adStateClosed) Then
stQuery = "SELECT * From inmoviliza_oper where numoperaci= " & pnumoperaci & " and idinmov= " & pidinmov & " "
'---------------------------------------
rst.Open stQuery, cnn, adOpenstatic, adLockBatchOptimistic
'---------------------------------------
End If
If rst.RecordCount <> 0 Then
rst!importrel = frmgrabarrelacion.txtimporterel.Text
rst.UpdateBatch
'aqui me da el error
modificar_registro = True
Else
modificar_registro = False
End If
Exit Function
err:
If err.Number = -2147417848 Then
Resume Next
Else
MsgBox err & " - " & error, vbCritical
End If
End Function
-- error, -2147217887 "La operacion en varios pasos genero errores,compruebe los valores de estado".
el codigo es el siguiente:
Public Function modificar_registro(ByVal pnumoperaci As Double, ByVal pidinmov As Double) As Boolean
Dim stQuery As String
Dim rst As ADODB.Recordset
Set rst = New ADODB.Recordset
On Error GoTo err
'strQuery = "SELECT * From inmoviliza_oper where numoperaci= " & pnumoperaci & " and idinmov= " & pidinmov & " "
'Set rst = bd.OpenRecordset(strQuery, dbOpenDynaset)
If (rst.State <> adStateClosed) Then
rst.Close
End If
If (rst.State = adStateClosed) Then
stQuery = "SELECT * From inmoviliza_oper where numoperaci= " & pnumoperaci & " and idinmov= " & pidinmov & " "
'---------------------------------------
rst.Open stQuery, cnn, adOpenstatic, adLockBatchOptimistic
'---------------------------------------
End If
If rst.RecordCount <> 0 Then
rst!importrel = frmgrabarrelacion.txtimporterel.Text
rst.UpdateBatch
'aqui me da el error
modificar_registro = True
Else
modificar_registro = False
End If
Exit Function
err:
If err.Number = -2147417848 Then
Resume Next
Else
MsgBox err & " - " & error, vbCritical
End If
End Function
Valora esta pregunta


0