ASP+Access 自动编号重置的最终解决办法
set rs=server.CreateObject("adodb.recordset")set targetconn=server.CreateObject("adodb.connection")
targetconn.open "Provider = Microsoft.Jet.OLEDB.4.0;Data Source = " & Server.MapPath("db/db1.mdb")
targetconn.execute("delete * from admingroupinf")
targetconn.execute("drop index id on admingroupinf") '删除索引
targetconn.execute("alter table admingroupinf drop column id") '删除列
targetconn.execute("alter table admingroupinf add column id autoincrement(0,1)") '这句的(0,1)是关键
targetconn.execute("create index id on admingroupinf(id)") '重新创建索引
targetconn.close
set targetconn=nothing
set rs=nothing --------------------编程问答-------------------- mark,赞一个。
补充:.NET技术 , ASP.NET