asp程序员进来看看
一个表插入的问题,看了很多asp的实例,照抄都不行,请熟悉的朋友看看,谢谢了,具体代码如下:
1\conn.asp
<%
dim conn,db
dim connstr
db="Databases/21asp.mdb" '数据库文件位置
on error resume next
connstr="DBQ="+server.mappath(""&db&"")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
set conn=server.createobject("ADODB.CONNECTION")
if err then
err.clear
else
conn.open connstr
end if
sub CloseConn()
conn.close
set conn=nothing
end sub
%>
2\插入文件
<%
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from test"
rs.open sql,conn,1,3
test1="aaa"
test2="bbb"
rs.addnew
rs("test1")=test1
rs("test2")=test2
rs.update
rs.close
%>
test表里有id,test1,test2,id为自动编号,test1 test2为char型.
我在iis里运行的时候怎么就提示500的错误啊.
谁帮我看看是怎么回事?