你试一下将异常打印出来,看一下是什么问题try{
       Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
       Connection conn=DriverManager.getConnection("jdbc:odbc:panchang");
       Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
       mystr1="delete * from employee where id = '" + mystr + "'";
       stmt.executeUpdate(mystr1);
       stmt.close();
       conn.close();}catch (SQLException e){out.print(e);}

解决方案 »

  1.   

    java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] 标准表达式中数据类型不匹配。
      

  2.   

    将mystr1="delete * from employee where id = '" + mystr + "'";
    改成mystr1="delete * from employee where id = " + mystr + ";
    因为你的字段id是数字,不是文本类型
      

  3.   

    多谢指点,我采用itok000的方法,结果没有问题。
    可是到我加上if else后,总告诉:else without if 
    catch without try天啊,我晕了
      

  4.   

    两处错误:
    1.delete中不使用*  
    2.字段类型不一致,id是数字,不要加引号,但如果mystr是String类型的,则需要转换
    mystr1="delete from employee where id = " + Integer.parseInt(mystr);