Bases de datos Actualizar!!!! Lo hago asi
Publicado por Ro (26 intervenciones) el 19/07/2004 22:58:49
yo lo hago de la siguiente manera
Set rsDetalleVenta = New Recordset
With rsDetalleVenta
.Source = "SELECT * FROM DetalleVenta WHERE Cerrado ='" & "NO" & "'"
.ActiveConnection = cnGest
.CursorType = adOpenStatic
.CursorLocation = adUseClient
.LockType = adLockOptimistic
End With
rsDetalleVenta.Open Options:=adCmdText
If rsDetalleVenta.RecordCount = 0 Then
GoTo Final:
Else
rsDetalleVenta.MoveFirst
For i = 1 To rsDetalleVenta.RecordCount
rsDetalleVenta!Cerrado = "SI"
rsDetalleVenta.MoveNext
Next
rsDetalleVenta.Update
End If
y me dice cuando actualizo que son muchas filas para actualizar , ( cuando paso los 3 registros mas o menos)
Set rsDetalleVenta = New Recordset
With rsDetalleVenta
.Source = "SELECT * FROM DetalleVenta WHERE Cerrado ='" & "NO" & "'"
.ActiveConnection = cnGest
.CursorType = adOpenStatic
.CursorLocation = adUseClient
.LockType = adLockOptimistic
End With
rsDetalleVenta.Open Options:=adCmdText
If rsDetalleVenta.RecordCount = 0 Then
GoTo Final:
Else
rsDetalleVenta.MoveFirst
For i = 1 To rsDetalleVenta.RecordCount
rsDetalleVenta!Cerrado = "SI"
rsDetalleVenta.MoveNext
Next
rsDetalleVenta.Update
End If
y me dice cuando actualizo que son muchas filas para actualizar , ( cuando paso los 3 registros mas o menos)
Valora esta pregunta


0