¿Error EOF BOF en VB6?

Hola tengo una duda, cuando quiero guardar me aparece el error "3021" El valor de BOF o EOF es True. Cual es el error?

Function Grabar() As Boolean

On Local Error GoTo LineaError

Dim RS As New ADODB.Recordset

RS.CursorLocation = adUseClient

If Trim(TxtInforme) = "" Then

MsgBox "Debe ingresar el Informe", vbExclamation

TxtInforme.SetFocus

Exit Function

End If

If Trim(TxtNestudio) = "" Then

MsgBox "Debe ingresar el número de Cine", vbExclamation

TxtNestudio.SetFocus

Exit Function

End If

Cnx.BeginTrans

RS.Open "SELECT * From HC where HC='" & TxtHC & "' and fecha=#" & TxtFecha & "#", Cnx, adOpenDynamic, adLockOptimistic

RS!Cine = TxtNestudio

RS!Informe = TxtInforme

RS.Update

SW = False

Cnx.CommitTrans

Set RS = Nothing

Grabar = True

Exit Function

LineaError:

Cnx.RollbackTrans

MsgBox Err.Description, vbCritical

End Function

Gracias!!!

Actualización:

Se lo que es BOF y EOF, y cuando uso un IF me dice que tanto EOF como BOF es TRUE... WTF? En la DB ya tengo datos cargados

Please enter comments
Please enter your name.
Please enter the correct email address.
You must agree before submitting.

Answers & Comments


Helpful Social

Copyright © 2024 ANSWERS.MX - All rights reserved.