ASP自动编号排序问题
来源:百度知道 编辑:UC知道 时间:2024/06/09 18:12:43
大家好,因为本人是业务学习ASP,很多地方不懂,忘大家帮我看看下面是哪里出错了,导致我网站上面有些生成了编号,有些没有。
是在access中的hyuser表的自动编号字段uidbh。
<%
sql="select * from [hyuser] where pass=1 order by uidbh DESC"
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "<p align=center class=font>暂无记录!</p>"
else
totalPut=rs.recordcount
totalPut=rs.recordcount
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showContent
showpage totalput,MaxPerPage,"member.asp"
else<
是在access中的hyuser表的自动编号字段uidbh。
<%
sql="select * from [hyuser] where pass=1 order by uidbh DESC"
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "<p align=center class=font>暂无记录!</p>"
else
totalPut=rs.recordcount
totalPut=rs.recordcount
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showContent
showpage totalput,MaxPerPage,"member.asp"
else<
设定了 自动编号
都会自动添加
和ASP没关系~
如果是Access,数据库中不能实现GB001这种效果,可以用自动编号字段,程序中模拟,给你个参考
ID = "GB" & string(3-len(rs("id")),"0") & rs("ID")
那不是分页的程序吗
gb001?还没听说字符可以自增长的。你可以在插入数据的时候处理一下
asp的代码,也可以为数据库做个触发器。
在MDB数据库里面的uidbh字段数据类型设定成自动编号应该可以的.
从GB001开始?GB001是什么...可以说清楚点吗?
你说的是001编号(3位数)是吗?从-1开始递增?那就设定成同步复制ID...或许...可以...
你说清楚点.说不定有人知道的.希望你能顺利解决问题!
ACCESS里面自动编号好象固定就是1,2,3,4...
如果想在网页里输出GB001,GB002,GB003...
可以这么写(数字前面都有00,不要00只要GB+数字的话可以把00去掉)
bianhao=GB00&rs("ID")
response.write(bianhao)