<%dimbaseclass,childclass,childbm,pbm,picture,pname,publish,factory,dw,size,price,dz,yhj,cd,num,goodsstate 'baseclass=mid(request.form("baseclass"),24) baseclass=mid(upload.form("baseclass"),24) 'childclass=mid(trim(request.form("childclass")),5) childclass=mid(trim(upload.form("childclass")),5) 'childbm=mid(trim(request.form("childclass")),1,4) childbm=mid(trim(upload.form("childclass")),1,4) 'picture=request.form("picture") picname=up_pic()'调用up_pic()函数,返回文件名 'pname=request.form("pname") pname=upload.form("pname") 'factory=request.form("factory") factory=upload.form("factory") 'dw=request.form("dw") dw=upload.form("dw") 'size=request.form("size") size=upload.form("size") price=upload.form("price") dz=upload.form("dz") num=upload.form("num") goodsstate=upload.form("goodsstate") publish=session("username") setrs=server.createobject("adodb.recordset") sql="selecttop1*fromgoodswherebaseclass='"&baseclass&"'andchildclass='"&childclass&"'orderbypbmdesc" rs.opensql,conn,1,3 ifrs.recordcount=0then pbm=childbm&"001" else pbm=childbm+right(cstr(rs("pbm")+1),3) endif rs.addnew rs("picture")=picname rs("baseclass")=baseclass rs("childclass")=childclass rs("pbm")=pbm rs("factory")=factory rs("dw")=dw rs("size")=size rs("price")=price rs("dz")=dz rs("num")=num rs("goodsstate")=goodsstate rs("publish")=publish rs("goodsstate")=goodsstate rs("inputtime")=now() rs("yhj")=upload.form("yhj") rs("info")=upload.form("info") rs("cd")=upload.form("cd") rs.update rs.close'使用完后关闭记录集setrs=nothing conn.close'关闭数据库连接对象setconn=nothing %> 数据提交成功! ! ! !
添加新数据 |