'下面是id的自动编号,从数据库中表link中找到最大的id,然后加1
<%
sql = "select max(ID) as m from link"
Set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open sql,conn,1,3
max=rs("m")
if isnull(max) then max=0
id1=Cint(max)+1
rs.close
set rs=nothing
%>