帮忙挑毛病 C# asp.net core 2.0“语法错误 (操作符丢失) 在查询表达式''中”错误

语法错误 (操作符丢失) 在查询表达式
[问题点数:20分,结帖人SimpleDay]
语法错误 (操作符丢失) 在查询表达式
[问题点数:20分,结帖人SimpleDay]
不显示删除回复
显示所有回复
显示星级回复
显示得分回复
只显示楼主
相关帖子推荐:
本帖子已过去太久远了,不再提供回复功能。asp access 语法错误 (操作符丢失) 在查询表达式 'sort_id=' 中
在两个表中找出相同的值分组,循环输出(同一组的只取一个)提示错误为:Microsoft JET Database Engine 错误 ';语法错误 (操作符丢失) 在查询表达式 'sort_id=' 中。就是 rs_sort.open &select  * from class2 where sort_id=&&rs_ground(&sort&),con,1,1%&这一行我把&&rs_ground(&sort&) 改为'&&rs_ground(&sort&)提示错误为:Microsoft JET Database Engine 错误 ';字符串的语法错误 在查询表达式 'sort_id='24' 中.&%set res=server.createobject(&adodb.recordset&)   res.open &select * from class&,con,1,1   while not res.eof%&   &tr&    &td width=&130& height=&20& bgcolor=&99FFcc&&      &STRONG&&img src=&img/iecool_arrow_021.gif& width=&12& height=&8& border=&0&&&/STRONG&        &b&&a href=&product?sort_idlei=&%=res(&sort_id&)%&&&&%=res(&sort&)%&&/a&&/b&&/td&&/tr&   &%set rs_ground=server.createobject(&adodb.recordset&)             rs_ground.open &select sort from product where sort_id='&&res(&sort_id&)&&' group by sort&,con,1,1%&              &%while not rs_ground.eof%&                  &%set rs_sort=server.createobject(&adodb.recordset&)  rs_sort.open &select  * from class2 where sort_id=&&rs_ground(&sort&),con,1,1%&                  &tr&   &td&   &a href=&?Sort_ID=&%=rs_ground(&sort&)%&&sort_idlei=&%=res(&sort_id&)%&&&&img src=&img/mark.gif& width=&9& height=&9& border=&0&&  &%=rs_sort(&sort&)%&&/a&&/td&&/tr&     &%rs_ground.movenext       wend%&         &%res.movenext wend%&   &%res.close     set res=nothing%&
09-07-08 & 发布
出错的页面并未接收到传来的变量 aa ,所以导致SQL语句出错另外,根据你的代码判断,你的这个 UName字段似乎是文本型,SQL语句中应该加上单引号ps.open &select * from zhuce where UName='& & request(&aa&)&&'&,conn,3,2
请登录后再发表评论!Microsoft JET Database Engine(0x80040E14)语法错误(操作符丢失)在查询表达式 &id=& 中
Microsoft JET Database Engine(0x80040E14)语法错误(操作符丢失)在查询表达式 &id=& 中 30
&% dim rs,strSq 
strSql=&Select * From users Where id=&&session(&id&) set rs=db.execute(strSql) %&
这段代码总是提示错误,不知道为什么,ID是数值(自动编号),所以没加引号,但怎么也不对,加了引号又提示类型错误。
不区分大小写匿名
不明白,什么是“重转系统”
=的左右加一个空格
还是不行!
尝试各个位置添加空格,都不行。
打错,是在&之后加一个空格
strSql="Select * From users Where id="&session("id") '怀疑你的session值失效,你把sql语句打印出来就知道了,然后复制到查询分析器查询下,哪出问题一目了然response.write(strSql)'加上这句set rs=db.execute(strSql) %&
相关知识等待您来回答
网页制作领域专家C#操作语法错误 (操作符丢失)在查询表达式‘OccurTime between
0:00:00 and
16:40C#操作access数据库,OccurTime 是日期时间类型的,运行出现错误,操作语法错误 (操作符丢失)在查询表达式‘OccurTime between 2013-_百度作业帮
C#操作语法错误 (操作符丢失)在查询表达式‘OccurTime between
0:00:00 and
16:40C#操作access数据库,OccurTime 是日期时间类型的,运行出现错误,操作语法错误 (操作符丢失)在查询表达式‘OccurTime between
0:00:00 and
16:40,查询语句如下select * from Alarms where OccurTime between " + DateTime.Parse(" 00:00:00") + " and " + DateTime.Parse(" 16:40:00")
between ' 0:00:00' and ' 16:40' 时间两边加单引号,不用DateTime.Parse语法错误 (操作符丢失) 在查询表达式_java吧_百度贴吧
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&签到排名:今日本吧第个签到,本吧因你更精彩,明天继续来努力!
本吧签到人数:0成为超级会员,使用一键签到本月漏签0次!成为超级会员,赠送8张补签卡连续签到:天&&累计签到:天超级会员单次开通12个月以上,赠送连续签到卡3张
关注:233,698贴子:
语法错误 (操作符丢失) 在查询表达式收藏
写了一个代码,但是连接数据库的时候有问题了,哪位高手能帮忙看一下啊import java.awt.*;
import java.sql.*; import javax.swing.*;import java.awt.event.*; class update extends JFrame implements ActionListener{
JLabel label1=new JLabel("车次"); JLabel label2=new JLabel("始发站"); JLabel label3=new JLabel("发车时间"); JLabel label4=new JLabel("类型"); JLabel label5=new JLabel("经过站1"); JLabel label6=new JLabel("经过站2"); JLabel label7=new JLabel("经过站3"); JLabel label8=new JLabel("经过站4");
JLabel label9=new JLabel("运行时间");
JLabel label10=new JLabel("终点站");
JLabel label11=new JLabel("到站时间");
JLabel label12=new JLabel("全程");
JTextField 车次Field=new JTextField(6); JTextField 始发站Field=new JTextField(6); JTextField 发车时间Field=new JTextField(6); JTextField 类型Field=new JTextField(6); JTextField 经过站1Field=new JTextField(6); JTextField 经过站2Field=new JTextField(6); JTextField 经过站3Field=new JTextField(6); JTextField 经过站4Field=new JTextField(6); JTextField 运行时间Field=new JTextField(6); JTextField 终点站Field=new JTextField(6); JTextField 到站时间Field=new JTextField(6); JTextField 全程Field=new JTextField(6); JButton
Button1 =new JButton("添加"); JButton
Button2 =new JButton("修改");
Button3 =new JButton("删除"); JButton
Button4 =new JButton("清除");
update() {
Container c=this.getContentPane();
c.setLayout(new GridLayout(3,1));
JPanel centerPanel=new JPanel(new GridLayout(7,2));
JPanel lowerPanel=new JPanel(new FlowLayout());
JLabel logol=new JLabel("列车信息");
logol.setFont(new Font("true",Font.TRUETYPE_FONT,20));//设置JLabel"列车信息"大小
c.add(logol);
// 将Jlabel和JTextField添加到面板上
centerPanel.add(label1);
centerPanel.add(车次Field);
centerPanel.add(label2);
centerPanel.add(始发站Field);
centerPanel.add(label3);
centerPanel.add(发车时间Field);
centerPanel.add(label4);
centerPanel.add(类型Field);
centerPanel.add(label5);
centerPanel.add(经过站1Field);
centerPanel.add(label6);
centerPanel.add(经过站2Field);
centerPanel.add(label7);
centerPanel.add(经过站3Field);
centerPanel.add(label8);
centerPanel.add(经过站4Field);
centerPanel.add(label9);
centerPanel.add(运行时间Field);
centerPanel.add(label10);
centerPanel.add( 终点站Field);
centerPanel.add(label11);
centerPanel.add(到站时间Field);
centerPanel.add(label12);
centerPanel.add(全程Field);
c.add(centerPanel);
//添加按钮到底面板上
lowerPanel.add(Button1);
lowerPanel.add(Button2);
lowerPanel.add(Button3);
lowerPanel.add(Button4);
c.add(lowerPanel);
Button1.addActionListener(this);
Button2.addActionListener(this);
Button3.addActionListener(this);
Button4.addActionListener(this);
this.setSize(500,500);
this.setTitle("更新列车信息");
this.setVisible(true);
this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
void actionPerformed(ActionEvent e)
//对不同的按钮事件进行处理
if(e.getSource()==Button1)
else if(e.getSource()==Button2)
{update();}
if(e.getSource()==Button3)
{delete();}
if(e.getSource()==Button4)
{clear();}
void add()
String 车次,始发站,发车时间,类型,经过站1,经过站2,经过站3,经过站4,运行时间,终点站,到站时间,全程;
车次=车次Field.getText();
始发站=始发站Field.getText();
发车时间=发车时间Field.getText();
类型=类型Field.getText();
经过站1=经过站1Field.getText();
经过站2=经过站2Field.getText();
经过站3=经过站3Field.getText();
经过站4=经过站4Field.getText();
运行时间=运行时间Field.getText();
终点站=终点站Field.getText();
到站时间=到站时间Field.getText();
全程=全程Field.getText();
// 添加信息功能,并判断是否为空
if(车次.length()==0||始发站.length()==0||发车时间.length()==0||类型.length()==0||经过站1.length()==0||经过站2.length()==0||经过站3.length()==0||经过站4.length()==0||运行时间.length()==0||终点站.length()==0||到站时间.length()==0||全程.length()==0)
{JOptionPane.showMessageDialog(this, "请添加完全信息");}
try{Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");}
catch(ClassNotFoundException e){}
con=DriverManager.getConnection("jdbc:odbc:EMP");
String sql=("insert into EMP values(' "+车次+" ',' "+始发站+" ',' "+发车时间+" ',' "+类型+" ',' "+经过站1+" ',' "+经过站2+" ',' "+经过站3+" ',' "+经过站4+" ',' "+运行时间+" ',' "+终点站+" ',' "+到站时间+" ’,' "+全程+" ')");
PreparedStatement ps=con.prepareStatement(sql);
ps.setString(1,车次);
ps.setString(2,始发站);
ps.setString(3,发车时间);
ps.setString(4,类型);
ps.setString(5,经过站1);
ps.setString(6,经过站2);
ps.setString(7,经过站3);
ps.setString(8,经过站4);
ps.setString(9,运行时间);
ps.setString(10,终点站);
ps.setString(11,到站时间);
ps.setString(12,全程);
ps.executeUpdate();
con.close();
JOptionPane.showMessageDialog(this,"添加成功");
catch(SQLException e)
System.out.println("E Code"+e.getErrorCode());
System.out.println("E M="+e.getMessage());
catch(Exception e)
{e.printStackTrace();} }} void update() {
String str车次,str始发站,str发车时间,str类型,str经过站1,str经过站2,str经过站3,str经过站4,str运行时间,str终点站,str到站时间,str全程;
str车次=车次Field.getText();
str始发站=始发站Field.getText();
str发车时间=发车时间Field.getText();
str类型=类型Field.getText();
str经过站1=经过站1Field.getText();
str经过站2=经过站2Field.getText();
str经过站3=经过站3Field.getText();
str经过站4=经过站4Field.getText();
str运行时间=运行时间Field.getText();
str终点站=终点站Field.getText();
str到站时间=到站时间Field.getText();
str全程=全程Field.getText();
// 修改信息功能,并判断是否为空
if(checkCheCi(str车次))
if(str始发站.length()==0||str发车时间.length()==0||str类型.length()==0||str经过站1.length()==0||str经过站2.length()==0||str经过站3.length()==0||str经过站4.length()==0||str运行时间.length()==0||str终点站.length()==0||str到站时间.length()==0||str全程.length()==0)
{JOptionPane.showMessageDialog(this, "请添加完全信息");}
try{Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");}
catch(ClassNotFoundException e){}
con=DriverManager.getConnection("jdbc:odbc:EMP");
String sql="update EMP
set 始发站='"+str始发站+"',发车时间='"+str发车时间+"',类型='"+str类型+"',经过站1='"+str经过站1+"',经过站2='"+str经过站2+"',经过站3='"+str经过站3+"',经过站4='"+str经过站4+"',运行时间='"+str运行时间+"',终点站='"+str终点站+"',到站时间='"+str到站时间+"',全程='"+str全程+"'
where 车次='"+str车次+"'";
PreparedStatement ps=con.prepareStatement(sql);
int count= ps.executeUpdate();
System.out.println(count);
JOptionPane.showMessageDialog(this,"修改成功");
catch(SQLException e)
System.out.println("E Code"+e.getErrorCode());
System.out.println("E M="+e.getMessage());
catch(Exception e)
{e.printStackTrace();}finally{
con.close();
}catch(Exception e){
System.out.println("关闭数据库连接时出错:"+e.getMessage());
}else{JOptionPane.showMessageDialog(this, "该列车信息不存在");}
void delete()
System.out.println("开始执行删除");
String str车次=车次Field.getText();
// 添加信息功能,并判断是否为空
if(str车次.length()==0)
{JOptionPane.showMessageDialog(this, "请添加完全信息");}
try{Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");}
catch(ClassNotFoundException e){}
con=DriverManager.getConnection("jdbc:odbc:EMP");
String sql="delete from EMP
where 车次='"+str车次+"'";
PreparedStatement ps=con.prepareStatement(sql);
//ps.setString(1,str车次);
ps.executeUpdate();
con.close();
JOptionPane.showMessageDialog(this,"删除成功");
catch(SQLException e)
System.out.println("E Code"+e.getErrorCode());
System.out.println("E M="+e.getMessage());
catch(Exception e)
{e.printStackTrace();}}}
void clear()
车次Field.setText("");
始发站Field.setText("");
发车时间Field.setText("");
类型Field.setText("");
经过站1Field.setText("");
经过站2Field.setText("");
经过站3Field.setText("");
经过站4Field.setText("");
运行时间Field.setText("");
终点站Field.setText("");
到站时间Field.setText("");
全程Field.setText(""); }
public boolean checkCheCi(String str车次){
String sql="SELECT * FROM EMP where 车次='"+str车次+"'";
Connection con=
Statement stmt=
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("jdbc:odbc:EMP");
stmt=con.createStatement();
ResultSet rs=stmt.executeQuery(sql);
while(rs.next())
}catch(Exception e){
e.printStackTrace();
stmt.close();
con.close();
} catch (SQLException e) {
e.printStackTrace();
void shutdown()
{setVisible(false);}public static void main(String args[]){ update frame=new update();}}
登录百度帐号推荐应用
为兴趣而生,贴吧更懂你。或}

我要回帖

更多关于 asp.net教程 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信