日期:2014-05-17  浏览次数:20794 次

为什么asp不能在access中插入数据
asp程序部分是:
<%
set   conn=server.createobject( "adodb.connection ")
conn.open   "driver={microsoft   access   driver   (*.mdb)};dbq= "&server.mappath( "example3.mdb ")
name=request.form( "name ")
tel=request.form( "tel ")
message=request.form( "message ")
exec= "insert   into   guestbook(name,tel,message)values( ' "+name+ " ', "+tel+ ", ' "+message+ " ') "
conn.execute   exec
conn.close
set   conn=nothing
%>
html部分是:
<html>
<head>
<title> 无标题文档 </title>
<meta   http-equiv= "Content-Type "   content= "text/html;   charset=gb2312 ">
</head>

<body   bgcolor= "#FFFFFF "   text= "#000000 ">
<form   name= "form1 "   method= "post "   action= "example5.asp ">
    name  
    <input   type= "text "   name= "name ">
    <br>
    tel  
    <input   type= "text "   name= "tel ">
    <br>
    message  
    <input   type= "text "   name= "message "   value= " ">
    <br>
    <input   type= "submit "   name= "Submit "   value= "提交 ">
    <input   type= "reset "   name= "Submit2 "   value= "重置 ">
   
</form>
<br>
</body>
</html>
运行的结果是:
无法显示网页  
试图访问的网页中存在程序问题,无法显示。  

--------------------------------------------

请尝试执行下列操作:

打开   localhost   主页,然后查找与所需信息相关的链接。  
单击刷新按钮,或稍后重试。

HTTP   错误   403.1   禁止访问:禁止执行访问
Internet   信息服务

--------------------------------------------

技术信息(用于支持人员)


背景:
试图从某一目录中执行   CGI、ISAPI   或其他可执行程序,但此目录不允许执行程序。


详细信息:
Microsoft   支持  
各位前辈们这是为什么呀!小弟怎么弄也不明白,希望各位高手们帮个忙呀!
 


------解决方案--------------------
权限设置好了吗?
------解决方案--------------------
看起来像是你没有勾选:站点属性-主目录-“脚本资源访问”
------解决方案--------------------
呵呵,是IIS设置的问题,是IIS6吧

允许脚本资源访问就OK


------解决方案--------------------
iis 5 也一样,默认那一项是不勾选的,而且默认文档没有index.asp,不知道微软怎么想的