Access - Modificar registros con código

 
Vista:

Modificar registros con código

Publicado por juanjo (2 intervenciones) el 15/02/2005 12:51:27
Hola a todos,
tengo una duda de principiante, me podeis por favor ayudar??

Cómo se hace desde el código:
abrir una tabla?
borrar un registro?
añadir un registro nuevo?

Muchisimas gracias de antemano
juanjo
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:Modificar registros con código

Publicado por 2PL (105 intervenciones) el 15/02/2005 17:04:38
Function Cambiar_datos_por_programa()
' ASI SE MANIPULA UNA BD DESDE CODIGO

Dim GesperDB As Database
Dim GCPN00RS As Recordset

Set GesperDB = DBEngine.Workspaces(0).Databases(0)
Set GCPN00RS = GesperDB.OpenRecordset("BD_TRABAJO")

GCPN00RS.MoveFirst
Do While Not GCPN00RS.EOF
If GCPN00RS("N00GNOM") = "11" Or GCPN00RS("N00GNOM") = "15" Then
GCPN00RS.Edit
GCPN00RS("REGULADOR") = (GCPN00RS("IMPORTE") * 100) / 7
GCPN00RS.Update
ElseIf GCPN00RS("N00GNOM") = "12" Or GCPN00RS("N00GNOM") = "16" Or GCPN00RS("N00GNOM") = 22 Or GCPN00RS("N00GNOM") = 32 Then
GCPN00RS.Edit
GCPN00RS("REGULADOR") = (GCPN00RS("IMPORTE") * 100) / 7
GCPN00RS.Update
End If
GCPN00RS.MoveNext
Loop

GCPN00RS.Close

End Function
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar