access如何将记录插入到指定行后?

我想我这个问题可能有些傻!但我确实不知道。我用insert into总是将记录插入到数据库的最后。我要插入到第2行,或是插入到字段userid=23的记录后或是记录前,这如何实现?
我的asp:
filename=server.mappath("questbook.mdb")
set conn=server.createobject("adodb.connection")
conn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & filename
conn.execute("insert into questbook (createdate,name,subject,content,reply) values(#1980-02-04#,'yl','hello','thisis',false)")
它会插到最后的。
还有,我想问一下:如何统计表中所有字段userid=12的记录一共有几条?
谢谢了

---------------------------------------------------------------

插到指定行后是不可能的
---------------------------------------------------------------

统计userid=12
select count(*) as aa from tablename where userid=12
rs("aa")就是记录条数
---------------------------------------------------------------

指定行?如果记录23前面根本没有位置让你插,你怎么插?
或许你想插到22中,那还不如用update

---------------------------------------------------------------

这是不可能的,也是没有必要的,要排序的话可以在表的设计方面和select语句方面下些功夫

Published At
Categories with Web编程
Tagged with
comments powered by Disqus