Ver Mensaje Individual
  #4 (permalink)  
Antiguo 20/08/2010, 15:05
Avatar de Lexther
Lexther
 
Fecha de Ingreso: agosto-2010
Mensajes: 8
Antigüedad: 13 años, 8 meses
Puntos: 0
Respuesta: Error "El uso de propiedad no es valido"

He probado el codigo de estas 3 formas y me ha enviado error

1.
Código vb:
Ver original
  1. Private Sub Eliminar_Click()
  2. Dim sql$, x As Long, y As Long
  3. Dim rst As ADODB.Recordset
  4.  
  5. Set rst = New ADODB.Recordset
  6.  
  7. sql$ = "Select CodClientes From Clientes Order By CodClientes"
  8.  
  9. With rst
  10. .CursorLocation = adUseClient
  11. .CursorType = adOpenKeyset
  12. .LockType = adLockOptimistic
  13. .Open sql$, CurrentProject.Connection, , , adCmdText
  14. End With
  15.  
  16. x = rst.RecordCount
  17. rst.MoveFirst
  18.  
  19. For y = 1 To x
  20. rst.CodClientes = y
  21. rst.Update
  22. rst.MoveNext
  23. Next y
  24.  
  25. Set rst = Nothing
  26. End Sub

2.
Código vb:
Ver original
  1. Private Sub Eliminar_Click()
  2. Dim sql$, x As Long, y As Long
  3. Dim rst As ADODB.Recordset
  4.  
  5. Set rst = New ADODB.Recordset
  6.  
  7. sql$ = "Select CodClientes From Clientes Order By CodClientes"
  8.  
  9. With rst
  10. .CursorLocation = adUseClient
  11. .CursorType = adOpenKeyset
  12. .LockType = adLockOptimistic
  13. .Open sql$, CurrentProject.Connection, , , adCmdText
  14. End With
  15.  
  16. x = rst.RecordCount
  17. rst.MoveFirst
  18.  
  19. For y = 1 To x
  20. rst!CodClientes = y
  21. rst.Update
  22. rst.MoveNext
  23. Next y
  24.  
  25. Set rst = Nothing
  26. End Sub

3.
Código vb:
Ver original
  1. Private Sub Eliminar_Click()
  2. Dim sql$, x As Long, y As Long
  3. Dim rst As ADODB.Recordset
  4.  
  5. Set rst = New ADODB.Recordset
  6.  
  7. sql$ = "Select CodClientes From Clientes Order By CodClientes"
  8.  
  9. With rst
  10. .CursorLocation = adUseClient
  11. .CursorType = adOpenKeyset
  12. .LockType = adLockOptimistic
  13. .Open sql$, CurrentProject.Connection, , , adCmdText
  14. End With
  15.  
  16. x = rst.RecordCount
  17. rst.MoveFirst
  18.  
  19. For y = 1 To x
  20. rst.Fields! CodClientes = y
  21. rst.Update
  22. rst.MoveNext
  23. Next y
  24.  
  25. Set rst = Nothing
  26. End Sub