Access - boton de modificaciones vb6.0

 
Vista:

boton de modificaciones vb6.0

Publicado por jose de jesus (1 intervención) el 22/10/2012 09:20:43
Private Sub cmdbuscar_Click()

estoy haciendo un sistemita para mi tesis y me sale un error en la parte de abajo me dice que la operacion no esta permitida si el objeto esta abierto estoy untilizando visual basic 6.0
espero su ayuda...

rs.Open "SELECT * FROM proveedores WHERE codigo = '" & Text10.Text & "' ", conec, adOpenDynamic, adLockBatchOptimistic


If rs.EOF = True Then

MsgBox "Proveedor NO Encontrado", vbOKOnly, "ALERTA"


Else
Text1.Text = rs!nombre
Text2.Text = rs!domicilio
Text3.Text = rs!telefono
Text4.Text = rs!codigopostal
Text5.Text = rs!municipio
Text6.Text = rs!estado
Text7.Text = rs!email
Text9.Text = rs!codigo
Text10.Text = rs!codigo

rs.Close
End If








End Sub



Private Sub cmdguardar_Click()

rs.Open "SELECT * FROM proveedores WHERE codigo = '" & Text10.Text & "' ", conec, adOpenDynamic, adLockBatchOptimistic

rs!nombre = Text1.Text
rs!domicilio = Text2.Text
rs!telefono = Text3.Text
rs!codigopostal = Text4.Text
rs!municipio = Text5.Text
rs!estado = Text6.Text
rs!email = Text7.Text
rs!fecha = Text9.Text


If Text1.Text = "" Or Text2.Text = "" Or Text3.Text = "" Or Text4.Text = "" Or Text5.Text = "" Or Text6 = "" Or Text7 = "" Or Text8 = "" Or Text9 = "" Then
MsgBox "Registro guardado", vbApplicationModal

Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text9.Text = ""
Text10.Text = ""

Else
rs.Update

MsgBox "Registro guardado", vbApplicationModal


Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""

cmdguardar.Enabled = False
cmdnuevo.Enabled = True
rs.Close
rs.Close
rs.Close

End If
End Sub

Private Sub cmdmodificar_Click()

Text1.Enabled = True
Text2.Enabled = True
Text3.Enabled = True
Text4.Enabled = True
Text5.Enabled = True
Text6.Enabled = True
Text7.Enabled = True
Text9.Enabled = True


End Sub

Private Sub Command1_Click()
Unload Me
End Sub



Private Sub Form_Load()

conec.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\JESUS\Documents\profe edgar\sistema herramientas\INVPROVEDORES.mdb;Persist Security Info=False"



Text1.Enabled = False
Text2.Enabled = False
Text3.Enabled = False
Text4.Enabled = False
Text5.Enabled = False
Text6.Enabled = False
Text7.Enabled = False
Text9.Enabled = False





End Sub
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