有懂asp的吗?帮一下小弟
小弟不懂asp
要写一个写入数据库的Asp程序
碰到了一点问题,不知道怎么解决,大家帮忙看目的地
大家帮我一下,谢谢,数据库表名是article处理数据库中第4个表。
////////提交//////////
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<title>软件发布</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<p>
<p>
<br><br>
<form method="POST" name="myform" action="adminsave.asp">
<div align="center"><center><table cellspacing="0" width="80%" border="1" cellpadding="0" cellspacing="0" bordercolor="#999999">
<tr>
<td width="100%" bgcolor="#999999" height="20"><font color="#FFFFFF"><center><p><b>软件发布</b></font></center></td>
</tr>
<tr align="center">
<td width="100%">
<table border="0" cellspacing="1" width="100%" height="595">
<tr>
<td width="15%" align="right" valign="top" height="16"></td>
<td width="85%" height="16">
</td></tr>
<tr>
<td width="15%" align="right" height="26"><b>软件名称:</b></td>
<td width="85%" height="26"><input type="text" name="softname" size="70"
class="smallinput" maxlength="100"></td>
</tr>
<tr>
<td width="15%" align="right" height="26">软件版本:</td>
<td width="85%" height="26">
<input type="text" name="bbh" size="70"
class="smallinput" maxlength="100">
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" height="20"><b>软件大小:</b></td>
<td width="85%" height="20">
<input type="text" name="softlen" size="70"
class="smallinput" maxlength="100">
</td>
</tr>
<tr>
<td width="15%" align="right" height="26"><b>作品类型:</b></td>
<td width="85%" height="26"><input type="text" name="softlx" size="70"
class="smallinput" maxlength="100">如:共享软件,免费软件....</td>
</tr>
<tr>
<td width="15%" align="right" height="26"><b>作者联系方式:</b></td>
<td width="85%" height="26"><input type="text" name="writer" size="70"
class="smallinput" maxlength="100">如:EMail,电话,网站</td>
</tr>
<tr>
<td width="15%" align="right" height="26"><b>应用平台:</b></td>
<td width="85%" height="26"><input type="text" name="softpt" size="70"
class="smallinput" maxlength="100">如:Windows9X,Windows2000...</td>
</tr>
<tr>
<td width="15%" align="right" height="23">下载地址1:</td>
<td width="85%" height="23"><input type="text" name="url1" size="70"
class="smallinput" maxlength="100"></td>
</tr>
<tr>
<td width="15%" align="right" height="25">下载地址1</td>
<td width="85%" height="25"><input type="text" name="url2" size="70"
class="smallinput" maxlength="100"></td>
</tr>
<tr>
<td width="15%" align="right" height="28">软件界面图:</td>
<td width="85%" height="28"><input type="text" name="softimg" size="70"
class="smallinput" maxlength="100"></td>
</tr>
<tr>
<td width="15%" align="right" height="309">软件介绍:</td>
<td width="85%" height="309"><textarea rows="15" name="softtext" cols="60" class="smallarea"></textarea></td>
</tr>
</table>
</td>
</tr>
</table>
</center></div><div align="center"><center><p><input type="submit" value=" 添 加 "
name="cmdok" class="buttonface"> <input type="reset" value=" 清 除 "
name="cmdcancel" class="buttonface"></p>
</center></div>
</form>
</body>
</html>
////////处理/////////
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
'<!--#include file="conn.asp"-->
<%
dim conn
dim connstr
dim db
db="article.mdb"
Set conn = Server.CreateObject("ADODB.Connection")
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(""&db&"")
conn.Open connstr
%>
<%
dim rs,sql
dim softname
dim bbh
dim softlen
dim softlx
dim softpt
dim writer
dim url1
dim errmsg
dim url2
dim softimg
dim softtext
dim founerr
founerr=false
if trim(request.form("softname"))="" then
founderr=true
errmsg="<li>软件名称不能为空</li>"
end if
if trim(request.form("bbh"))="" then
founderr=true
errmsg=errmsg+"<li>版本号不能为空</li>"
end if
if trim(request.form("softlen"))="" then
founderr=true
errmsg=errmsg+"<li>软件大小不能为空</li>"
end if
if trim(request.form("softlx"))="" then
founderr=true
errmsg=errmsg+"<li>软件类型不能为空</li>"
end if
if trim(request.form("writer"))="" then
founderr=true
errmsg=errmsg+"<li>联系方式不能为空</li>"
end if
if trim(request.form("url1"))="" then
founderr=true
errmsg=errmsg+"<li>软件下载地址不能为空</li>"
end if
if trim(request.form("softtext"))="" then
founderr=true
errmsg=errmsg+"<li>软件介绍不能为空</li>"
end if
set rs=server.createobject("adodb.recordset")
sql="select * from article"
rs.open sql,conn,1,1
rs.addnew
rs("softname")=softname '软件名称
rs("bbh")=bbh '版本号
rs("softlen")=softlen '软件大小
rs("softlx")=softlx '软件类型,如共享,免费等。。
rs("writer")=writer '作者联系方式
rs("softpt")=softpt '运行平台
rs("url1")=url1 '下载地址1
rs("url2")=url2 '下载地址2
rs("softimg")=softimg '软件界面
rs("softtest")=softtext '软件介绍
if request.form("writer")<>"" then
rs("writer")=trim(request.form("writer"))
end if
if request.form("writefrom")<>"" then
rs("writefrom")=trim(request.form("writefrom"))
end if
'rs("dateandtime")=date()
rs.update
'articleid=rs("articleid")
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
''''''''''''''''''''''''''''''''''''''''''''''''''''''
<div align="center"><center>
<br><br>
<table width="50%" border="1" cellpadding="0" cellspacing="0" bordercolor="#999999">
<tr>
<td width="100%" bgcolor="#999999" height="20"><p align="center"><font color="#FFFFFF"><b>
</tr>
<tr>
<td width="100%"><p align="left"><br>
软件序号为:<%response.write "article"&articleid%><br>
软件名称为:<%response.write softname%></p>
</td>
</tr>
</table>
</center></div>
<%
else
response.write "由于以下的原因不能保存数据:"
response.write errmsg
end if
%>
</body>
</html>