郁闷不知道哪里错了
<%
dim startyear
dim startmon
dim startday
dim code
dim inputno
startyear = year(now())
startmon = month(now())
startday = day(now())
Dim conn,rs,strSql1
Set rs=Server.CreateObject("ADODB.Recordset")
strSql1 ="select top 1 no from wzbg order by date desc"
rs.Open strSql1,conn,1
if startmon<10 then
startmon="0"&month(date)
end if
if startday<10 then
startday="0"&day(date)
end if
if startyear&startmon&startday<>left((rs.Fields.Item("no").Value),8) then
code=001
else
code=int(mid((rs.Fields.Item("no").Value),9,3))+1
end if
if len(code)=1 then
code="00"&cstr(code)
end if
if len(code)=2 then
code="0"&cstr(code)
end if
inputno = startyear & startmon&startday&cstr(code)
%>
然后界面里<input name="no" readonly="true" type="CHAR" value="<%response.Write(inputno)%>" />