<!-- #include file="conn.asp "-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>添加结果</title>
<style type="text/css">
<!-
body {
margin-top: 0px;
margin-bottom: 0px;
background-image: url();
background-repeat: no-repeat;
}img{ border:0px;}
-->
</style></head>
<body>
<table width="800" border="0" align="center" cellspacing="0">
<tr>
<td width="218" height="72">&nbsp;</td>
<td width="376">&nbsp;</td>
<td width="200">&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td align="center" valign="middle">
<%
set rs=server.createobject("adodb.recordset")
rs.open "select * from user where UserName='"&session("user")&"'",conn,1,1
a=rs("UserID")set rst=Server.CreateObject("ADODB.recordset")
    
    rst.open "productsInfo",conn,1,3
    rst.addnew'插入数据到productInfo表
    rst("UserID")=a
    rst("productName")=request.Form("f_productName")
    rst("place")=request.Form("f_place")
    rst("grade")=request.Form("f_grade")
    rst("price")=request.Form("f_price")
    rst("transTime")=request.Form("f_transTime")
    rst("address")=request.Form("f_address")
    rst("source")=request.Form("f_source")
    b=now()
    rst("time")=formatdatetime(b,2)
    rst.update
    rst.close
    
        if err.number<>0 then
    %>
<font size="+9" color="red">添加失败</font><br>
    <% 
        else 
    %>
        <font size="+9" color="#339933">添加成功<%=a%></font><br><br>
        <a href="createInfo.asp"><img src="image/back.jpg"></a>
    <%
        end if
        
        set rst = nothing '释放rst这个recordset对象所占得资源
        conn.close    '关闭conn这个connection对象
        set conn=nothing    '释放connection对象所占得资源
    %></td>
<td>&nbsp;</td>
</tr>
<tr>
<td height="154">&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
</body>
</html>以下是出事代码和运行结果图: