查询是否存在
<%
m=request.Form("username")
Set rs=Server.CreateObject("ADODB.RecordSet")
sql = "Select count(useryhm) from Dv_user WHERE useryhm='"&m&"'"
set rs=conn.execute(sql)
if rs(0) <> 0 then
response.write "<script language=javascript>alert('对不起用户名已经存在');history.back()</script>"
end if
%>
插入
<%
Set rs= Server.CreateObject ("ADODB.Command")
rs.open"Select * From mjdhb",Conn,1,3
rs.addnew
rs("炉号")=?
rs("厂家")=?
rs("编号")=?
rs("模号")=?
rs("状态")=?
rs.Update
rs.close
Set rs=nothing
Response.End
%>