This Text file is old! In a ðŸ›ï¸Museum, an unsorted archive of (user-)pages. (Saved from Geocities in Oct-2009. The archival story: oocities.org)
--------------------------------------- (To 🚫report any bad content: archivehelp @ gmail.com)
>

Alguien me envió la siguiente duda a mi correo:

Una pregunta, tengo un problema en access, necesito trabajar directamente con una tabla, donde pueda anexar y eliminar. Solo me gustaria saber donde esta mi error, ¿puedes decirme? Ya he buscado diferentes maneras y nada agradecere tu apoyo.
 
Private Sub Comando0_Click()
    Dim Rst As New ADODB.Recordset
    Dim StrSQL As String
        StrSQL = "select * from prueba;"
        Rst.Open StrSQL, CurrentProject.Connection, adOpenDynamic
        While Not Rst.EOF
            Rst.AddNew
            Rst.Fields(0) = "hola"
            Rst.Update
            Rst.MoveNext
        Wend
        Rst.Close
        Set Rst = Nothing
End Sub
 

Y Búho le respondió:
====================

Pues tienes dos opciones, a escoger la que mas te guste: 
 
StrSQL = "select * from prueba;" 
Rst.Open StrSQL, CurrentProject.Connection, adOpenKeyset, adLockOptimistic 
 
o.... 
 
 
Rst.CursorType = adOpenKeyset 
Rst.LockType = adLockOptimistic 
StrSQL = "select * from prueba;" 
Rst.Open StrSQL, CurrentProject.Connection 
 
 
Además fijate un poco en el bucle que has construido...como no haya registros
en la tabla, no podrás añadir ninguno nuevo....supongo que estarías haciendo una prueba. 

Text file Source (historic): geocities.com/es/ensolva/Descargas/Documentos

geocities.com/es/ensolva/Descargas
geocities.com/es/ensolva
geocities.com/es

(to report bad content: archivehelp @ gmail)