Foros del Web » Programación para mayores de 30 ;) » Programación General »

Error con Adodc1 en Visual Basic 6.0

Estas en el tema de Error con Adodc1 en Visual Basic 6.0 en el foro de Programación General en Foros del Web. Disculpen la molestia estoy haciendo una aplicacion con una base de datos en access 2007 y el unico error que tengo es cuando intento ingresar ...
  #1 (permalink)  
Antiguo 06/02/2015, 13:02
 
Fecha de Ingreso: febrero-2015
Mensajes: 4
Antigüedad: 9 años, 2 meses
Puntos: 0
Exclamación Error con Adodc1 en Visual Basic 6.0

Disculpen la molestia estoy haciendo una aplicacion con una base de datos en access 2007 y el unico error que tengo es cuando intento ingresar los datos a la base es decir que lleno los campos con sus respectivos datos y al presionar el boton de agregar me sale un error en Adodc1 ya volvi a realizar la vinculacion y todo y me sigue generando lo mismo! espero me puedan ayudar de ante mano muchas gracias por su atencion.

a continuacion les dejare el codigo total de todo el programa esperando que me ayuden con el error


Private Sub cmd_abrir_Click()
Abrir_01.DialogTitle = "Seleccione La Imagen Del Cliente"
Abrir_01.InitDir = "C:\Documents and Settings\All Users\Documentos"
Abrir_01.Filter = "Todos Los Archivos... |*.*|Formato JPG..|*.jpg|Formato BMP...|*.bmp|"
Abrir_01.ShowOpen
foto.Picture = LoadPicture(Abrir_01.FileName)
lblname.Caption = Abrir_01.FileTitle
If lblname.Caption = "" Then
MsgBox "Seleccione una Imagen Para El Cliente >> De lo Contrario CANCELE La Operación", vbInformation, "Mensaje"
Else
lblname.Caption = Abrir_01.FileTitle
' FileCopy Abrir_01.FileName, App.Path & "\\" & Abrir_01.FileTitle
End If

End Sub

Private Sub cmd_agregar_Click()
Adodc1.Recordset.Update <======== aqui me genera el error
Adodc1.Recordset.MoveFirst
X = App.Path
foto.Picture = LoadPicture(X & "\" & lblname.Caption)
txt_codigo.Enabled = False
txt_nombres.Enabled = False
txt_apellidos.Enabled = False
txt_edad.Enabled = False
Text1.Enabled = False
Text2.Enabled = False
Text3.Enabled = False
Text5.Enabled = False
Text6.Enabled = False
Combo1.Enabled = False
Combo2.Enabled = False
Combo3.Enabled = False
FileCopy Abrir_01.FileName, App.Path & "\\" & Abrir_01.FileTitle
cmd_cancelar.Enabled = False
cmd_abrir.Enabled = False
cmd_agregar.Enabled = False
cmd_nuevo.Enabled = True
End Sub

Private Sub cmd_anterior_Click()
Adodc1.Recordset.MovePrevious
If Adodc1.Recordset.BOF Then
Adodc1.Recordset.MoveLast
End If
X = App.Path
foto.Picture = LoadPicture(X & "\" & lblname.Caption)
End Sub

Private Sub cmd_cancelar_Click()
txt_codigo.Enabled = False
txt_nombres.Enabled = False
txt_apellidos.Enabled = False
txt_edad.Enabled = False
Text1.Enabled = False
Text2.Enabled = False
Text3.Enabled = False
Text5.Enabled = False
Text6.Enabled = False
Combo1.Enabled = False
Combo2.Enabled = False
Combo3.Enabled = False
Combo4.Enabled = False
Command1.Enabled = False
Command3.Enabled = False
Adodc1.Refresh
Adodc1.Recordset.MoveFirst
X = App.Path
foto.Picture = LoadPicture(X & "\" & lblname.Caption)
cmd_nuevo.Enabled = True
cmd_agregar.Enabled = False
cmd_abrir.Enabled = False
cmd_cancelar.Enabled = False

End Sub

Private Sub cmd_nuevo_Click()
Adodc1.Recordset.AddNew
txt_codigo.Enabled = False
txt_nombres.Enabled = True
txt_apellidos.Enabled = True
txt_edad.Enabled = True
Text1.Enabled = True
Text2.Enabled = True
Text3.Enabled = True
Text5.Enabled = True
Text6.Enabled = True
Combo1.Enabled = True
Combo2.Enabled = True
Combo3.Enabled = True
Combo4.Enabled = True
Command1.Enabled = True
Command3.Enabled = True
lblname.Caption = ""
foto.Picture = LoadPicture(lblname.Caption)
txt_nombres.Text = ""
txt_apellidos.Text = ""
txt_edad.Text = ""
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text5.Text = ""
Text6.Text = ""
cmd_abrir.Enabled = True
cmd_cancelar.Enabled = True
cmd_agregar.Enabled = True
cmd_nuevo.Enabled = False
End Sub

Private Sub cmd_primero_Click()
Adodc1.Recordset.MoveFirst
X = App.Path
foto.Picture = LoadPicture(X & "\" & lblname.Caption)
End Sub
Private Sub cmd_siguiente_Click()
Adodc1.Recordset.MoveNext
If Adodc1.Recordset.EOF Then
Adodc1.Recordset.MoveFirst
End If
X = App.Path
foto.Picture = LoadPicture(X & "\" & lblname.Caption)
End Sub

Private Sub cmd_ultimo_Click()
Adodc1.Recordset.MoveLast
X = App.Path
foto.Picture = LoadPicture(X & "\" & lblname.Caption)
End Sub

Private Sub Command1_Click()
Adodc1.Recordset.Delete
End Sub

Private Sub Command2_Click()
End
End Sub

Private Sub Command3_Click()
Dim buscar As String, criterio As String
buscar = InputBox("¿QUE NOMBRE DESEA BUSCAR?", "busqueda por nombre", vbQuestion)
If buscar = "" Then Exit Sub
criterio = "nombre like '*" & buscar & "*'"
Adodc1.Recordset.MoveNext
If Not Adodc1.Recordset.EOF Then
Adodc1.Recordset.Find criterio
End If
If Adodc1.Recordset.EOF Then
Adodc1.Recordset.MoveFirst
Adodc1.Recordset.Find criterio
If Adodc1.Recordset.EOF Then
Adodc1.Recordset.MoveLast
respuesta = MsgBox("NOMBRE NO ENCONTRADO", vbCritical)
End If
End If
End Sub

Private Sub Form_Load()
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\Administrador\Escritorio\BASE DE DATOS\APLICACION ACADEMIA EMANUEL\Base.mdb;Persist Security Info=False"
Adodc1.CursorType = adOpenDynamic
Adodc1.RecordSource = "Clientes"
Adodc1.Refresh
Adodc1.Recordset.MoveFirst
Adodc1.Visible = False
X = App.Path
foto.Picture = LoadPicture(X & "\" & lblname.Caption)
txt_codigo.Enabled = False
txt_nombres.Enabled = False
txt_apellidos.Enabled = False
txt_edad.Enabled = False
Text1.Enabled = False
Text2.Enabled = False
Text3.Enabled = False
Text5.Enabled = False
Text6.Enabled = False
Combo1.Enabled = False
Combo2.Enabled = False
Combo3.Enabled = False
Combo4.Enabled = False
Command1.Enabled = False
Command3.Enabled = False
cmd_abrir.Enabled = False
cmd_cancelar.Enabled = False
cmd_agregar.Enabled = False
End Sub


[IMG]file:///C:/Documents%20and%20Settings/Administrador/Mis%20documentos/Mis%20im%C3%A1genes/error.JPG[/IMG]

Etiquetas: app, basic, database, formato, string, visual
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 19:39.