注册 登录
编程论坛 ASP.NET技术论坛

两表关联查询提示 From子句语法错误

guming 发布于 2007-12-07 14:52, 1419 次点击
使用Accecss,,,两个表关联查询,下面的SQL语句老是提示 From子句语法错误,请各位帮我看一下了,非常谢谢
......
datacon(); //初始化链接
OleDbDataAdapter thisadpt=new OleDbDataAdapter("Select user.uid,user.logtime,user.score,article.uid,article.title,article.author,article.content,article.uptime [bold]from user inner join article on user.uid=article.uid[/bold]",thisCON);
 DataSet theSet=new DataSet();
thisadpt.Fill(theSet);
......
6 回复
#2
bygg2007-12-07 15:15
把user改成 [user]
#3
guming2007-12-07 17:17
改了之后:
...
datacon();
OleDbDataAdapter theadpt=new OleDbDataAdapter("Select user.uid,user.logtime,user.score,article.uid,article.title,article.author,article.content,article.uptime from [user] inner join [article] on user.uid=article.uid",thisCON);
DataSet theSet=new DataSet();
theadpt.Fill(theSet);
infotb.DataSource=theSet;
infotb.DataBind();
thisCON.Close();
...

提示这样的错误:不能在 Memo、OLE 或超级链接对象 (user.uid=article.uid) 中连接。
#4
bygg2007-12-07 17:27
user.uid=article.uid   把这里的 user 一起改了吧....

我这里没有你所说的那种错误
#5
guming2007-12-07 17:30
还是一样..
不能在 Memo、OLE 或超级链接对象 ([user].uid=[article].uid) 中连接 // 出现这样的错误提示又是什么原因呢?

[[italic] 本帖最后由 guming 于 2007-12-7 17:31 编辑 [/italic]]
#6
guming2007-12-07 18:19
我把字段类型搞错了,不能用备注..........Thanks
#7
bygg2007-12-08 14:06
呵呵,解决就好
1