[Microsoft][ODBC Microsoft Access 驱动程序] 语法错误 (操作符丢失)
PS:提示错误在查询表达式'notin(selecttop1userIdfromuserInfo)'中要实现分页操作贴上部分程序ResultSetrs=sm.execut...
PS:提示错误 在查询表达式 'not in (select top 1 userId from userInfo)' 中
要实现分页操作贴上部分程序
ResultSet rs=sm.executeQuery("select count(*) from (select distinct * from userInfo) ");
if(rs.next()){rowcount=rs.getInt(1);}//查询结果为一行一列
//计算pagecount
if(rowcount%pagesize==0){
pagecount=rowcount/pagesize;}
else{
pagecount=rowcount/pagesize+1;}
//查出需显示的记录
n=pagesize*(pagenow-1)+1;
rs=sm.executeQuery("select top "+pagesize+" * from userInfo where not in (select top "+n+" userId from userInfo) "); 展开
要实现分页操作贴上部分程序
ResultSet rs=sm.executeQuery("select count(*) from (select distinct * from userInfo) ");
if(rs.next()){rowcount=rs.getInt(1);}//查询结果为一行一列
//计算pagecount
if(rowcount%pagesize==0){
pagecount=rowcount/pagesize;}
else{
pagecount=rowcount/pagesize+1;}
//查出需显示的记录
n=pagesize*(pagenow-1)+1;
rs=sm.executeQuery("select top "+pagesize+" * from userInfo where not in (select top "+n+" userId from userInfo) "); 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询