
Para Ingresar y Modificar los registros en el acces me corre super bien, pero al momento de eliminarlos no lo hace....
AYUDA PLZ!!
El codigo que estoy usando es este:
if(ae.getSource().equals(btnEliminar))
{
try {
Connection conexion = DriverManager.getConnection("jdbc:odbc:SISTEMA");
Statement sentencia = conexion.createStatement(); // Crear el objeto Statement
String Cadena = new String("");
Cadena = "SELECT Rut, Nombre, Edad FROM Ingresos WHERE Rut = '"+txtRut.getText()+"'";
resultado = sentencia.executeQuery(Cadena);
if (resultado.next())
{
JOptionPane.showMessageDialog(f,"Se ah eliminado registro : "+txtNombre.getText(),
"AVISO",JOptionPane.INFORMATION_MESSAGE, new ImageIcon("imagen/diablo.gif"));
limpia();
resultado = sentencia.executeQuery("DELETE * FROM Ingresos WHERE Rut = '"+txtRut.getText()+"'");
}
else
{
JOptionPane.showMessageDialog(f,"Eliminacion Fallida","AVISO",JOptionPane.ERROR_MESSAGE);
limpia();
}
}
catch(SQLException ex){}
}
PD: Si es un error muy tonto digalo igual :)