Ya logre conectarme a la mi base de datos access gracias a que ayer me ayudaron a hacerlo, y ya pude insertar un registro mediante una instruccion insert. les pongo mi codigo:
Código:
la primer parte de codigo lo hace bien el problema esta cuando abro el registro y quiero ir al ultimo registro para obtener el id del ultimo registro insertado y me manda un error que dice que: abre_conexion On Error GoTo Y: conexion.BeginTrans comando = "INSERT INTO historias(especialidad,fecha,edad,nombre,sexo,ocupacion,edo_civil,escolaridad,direccion,lugar_nacimiento,ante_n_p,ante_p,ante_heredo)" comando = comando + "VALUES ('" + h_especialidad.Text + "','" + h_fecha.Caption + "','" + h_edad.Text + "','" + h_nombre.Text + "','" + h_sexo.List(h_sexo.ListIndex) + "','" + h_ocupacion.Text + "','" + h_edo_civil.List(h_edo_civil.ListIndex) + "','" + h_esco.Text + "','" + h_direccion.Text + "','" + h_naci.Text + "','" + h_ante_n_p.Text + "','" + h_ante_p.Text + "','" + h_heredo.Text + "')" conexion.Execute (comando) MsgBox "El paciente se ha almacenado correctamente" Abre_registro registro.MoveLast MsgBox registro.Fields(0).Value cierra_registro conexion.CommitTrans cierra_conexion
"El conjunto de filas no admite recuperacion hacia atras"
Espero alguien me pueda ayudar
Gracias.


