大家帮我看看,为什么总是报错:未指定的错误,db.inc.asp, 第 6 行

问题描述

一注册<html><head><metahttp-equiv="Content-Type"content="text/html;charset=gb2312"/><title>注册页面</title><styletype="text/css"><!--body{margin-top:0px;margin-bottom:0px;background-image:url();background-repeat:no-repeat;}.STYLE1{color:#FF0000}--></style></head><body><tablewidth="800"height="597"border="0"align="center"cellspacing="0"><tr><tdheight="597"align="center"valign="top"><tablewidth="800"border="0"cellspacing="0"><tr><tdwidth="91"height="114">&nbsp;</td><tdwidth="310">&nbsp;</td><tdwidth="304"align="center"valign="bottom">&nbsp;</td><tdwidth="87">&nbsp;</td></tr><tr><tdheight="74">&nbsp;</td><tdcolspan="2">&nbsp;</td><td>&nbsp;</td></tr><tr><tdheight="205">&nbsp;</td><tdcolspan="2"bgcolor="#F9F9F9"><formid="form1"name="form1"method="post"action="result.asp"><tablewidth="90%"border="1"align="center"cellpadding="5"cellspacing="0"><tr><tdcolspan="3">请在下面填写您的注册资料,红色<spanclass="STYLE1">*</span>号所标示的选项为必填项</td></tr><tr><tdwidth="24%"align="right">用户名:</td><tdwidth="37%"align="left"><inputname="f_user"type="text"id="f_user"/></td><tdwidth="39%"align="left"><spanclass="STYLE1">*</span></td></tr><tr><tdalign="right">密码:</td><tdalign="left"><inputname="f_code"type="password"id="f_code"/></td><tdalign="left"><spanclass="STYLE1">*</span></td></tr><tr><tdalign="right">姓名:</td><tdalign="left"><inputname="f_name"type="text"id="f_name"/></td><tdalign="left"><spanclass="STYLE1">*</span></td></tr><tr><tdalign="right">性别:</td><tdalign="left"><selectname="f_sex"id="f_sex"><optionvalue="男"selected="selected">男</option><optionvalue="女">女</option></select></td><tdalign="left"><spanclass="STYLE1">*</span></td></tr><tr><tdalign="right">年龄:</td><tdalign="left"><inputname="f_age"type="text"id="f_age"size="8"/></td><tdalign="left"><spanclass="STYLE1">*</span></td></tr><tr><tdcolspan="3"align="center"><inputtype="submit"name="Submit"value="提交注册资料"/>&nbsp;&nbsp;&nbsp;<inputtype="reset"name="Submit2"value="重置表单"/></td></tr></table></form></td><td>&nbsp;</td></tr><tr><tdheight="69">&nbsp;</td><tdcolspan="2">&nbsp;</td><td>&nbsp;</td></tr></table></td></tr></table></body></html>二、注册提交后处理的程序:result.asp<!--#includefile="db.inc.asp"--><html><head><metahttp-equiv="Content-Type"content="text/html;charset=gb2312"/><title>注册结果</title><styletype="text/css"><!-body{margin-top:0px;margin-bottom:0px;background-image:url();background-repeat:no-repeat;}--></style></head><body><%onerrorresumenext%><tablewidth="800"border="0"align="center"cellspacing="0"><tr><tdwidth="218"height="72">&nbsp;</td><tdwidth="376">&nbsp;</td><tdwidth="200">&nbsp;</td></tr><tr><td>&nbsp;</td><tdalign="center"valign="middle"><%'创建Recordset的对象方法1setrst=server.CreateObject("ADODB.recordset")rst.open"select*fromuserwhereu_user='"&request.form("f_user")&"'",conn,1,1ifrst.recordcount>0thenresponse.Write"用户名:"&request.Form("f_user")&"已经被占用,请从新注册!"rst.closesetrst=nothingconn.closesetconn=nothingresponse.Endelserst.closeconn.begintrans'开启事务,在对数据进行操作前开启rst.open"user",conn,1,3rst.addnewrst("u_user")=request.Form("f_user")rst("u_code")=request.Form("f_code")rst.updaterst.close'获取刚才插入数据的自动编号字段值,u_id字段的值'setrst1=conn.execute("select@@identityasuid")uid=rst1("uid")rst.open"info",conn,1,3rst.addnew'插入数据到info表rst("i_uid")=uidrst("i_name")=request.Form("f_name")rst("i_sex")=request.Form("f_sex")rst("i_age")=request.Form("f_age")rst("i_vip")=falserst.updaterst.closeiferr.number<>0thenconn.rollbacktrans'数据操作出错,取消事务并结束%><imgsrc="1.jpg"width="113"height="69"/><br><%elseconn.committrans'数据操作成功,保存事务并关闭%><imgsrc="2.jpg"width="113"height="69"/><%endifendif%></td><td>&nbsp;</td></tr><tr><tdheight="154">&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr></table><%setrst=nothingconn.closesetconn=nothing%></body></html>三,数据库<%Dimconnstrconnstr="Provider=Microsoft.Jet.OLEDB.4.0;DataSource="&Server.MapPath("Equ.mdb")Setconn=Server.CreateObject("ADODB.Connection")conn.openconnstr%>有人告诉我把result.asp中的,rst.open"select*fromuserwhereu_user='"&request.form("f_user")&"'",conn,1,1user加上[],后,我在办公室的电脑上运行总是提示注册失败的图片。而在我家里的电脑上却总提示:未指定的错误db.inc.asp,第6行我总觉得这一行没有错误呀。请高手指点。

解决方案

解决方案二:
用rst.recordcount的话,要rst.CursorLocation=3setrst=server.CreateObject("ADODB.recordset")rst.CursorLocation=3rst.open"select*from[user]whereu_user='"&request.form("f_user")&"'",conn,1,1ifrst.recordcount>0then---------------------------未指定的错误db.inc.asp,第6行conn.openconnstr数据库连接可能有问题,可能是权限问题命令行窗口执行cacls"c:xxx*.*.mdb"/T/E/GEveryone:F
解决方案三:
写错了是cacls"c:xxx*.*"/T/E/GEveryone:F
解决方案四:
我按你的方法添加后在下面这条语句上又报错:rst.open"user",conn,1,3提示说:无效的SQL语句;期待'DELETE'、'INSERT'、'PROCEDURE'、'SELECT'、或'UPDATE'。其中:user为数据库中的表名.这个语句应该怎么写呢,改成[user]后,提示:参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突。这些语句我是看了FIF教程照抄的,怎么有这么多错呀??
解决方案五:
rst.open"user",conn,1,3一般不要这么写,不如写成rst.open"SELECT*FROM[user]WHERE1=0",conn,1,3

时间: 2024-07-29 05:16:46

大家帮我看看,为什么总是报错:未指定的错误,db.inc.asp, 第 6 行的相关文章

jaxen-测试出错谁帮我看一下junit 报错 这个是什么原因

问题描述 测试出错谁帮我看一下junit 报错 这个是什么原因 java web的一个junit测试错误 谁帮我看一下 java.lang.NoClassDefFoundError: org/jaxen/JaxenException at org.dom4j.DocumentFactory.createXPath(DocumentFactory.java:230) at org.dom4j.tree.AbstractNode.createXPath(AbstractNode.java:207)

统计学生成绩的c,编译没报错,运行错误

问题描述 统计学生成绩的c,编译没报错,运行错误 #include /*这是一个查询学生成绩的程序,查询数学,英语,语文,计算并算出总成绩*/ /*首先,显示输入学生人数,然后显示输入各科成绩,最后按照学号排序输出各科 成绩.最后计算并显示出各科成绩的平均值,最大值,最小值*/ /*在main函数中既有printf1函数,scanf函数,printf2函数,arg函数,min函数 max函数*/ void input(double s[][4],int n); void output(doubl

java web-javaweb程序放在resin上运行报错,具体错误如下

问题描述 javaweb程序放在resin上运行报错,具体错误如下 javax.servlet.ServletException: Unable to load configuration. - bean - jar:file:/e:/qingniusoftware/Payment/WebRoot/WEB-INF/lib/struts2-core-2.1.8.1.jar!/struts-default.xml:29:72 at com.caucho.server.dispatch.FilterM

Jersey上传图片报错,409错误

问题描述 Jersey上传图片报错,409错误 com.sun.jersey.api.client.UniformInterfaceException: PUT http://localhost:8081/ecps-file/image/20160224100959304331.jpg returned a response status of 409 解决方案 http://blog.csdn.net/a0100034930/article/details/42433465

帮帮忙看看我这报错的是什么意思?

问题描述 ServerErrorin'/'Application.--------------------------------------------------------------------------------Cannotusealeading..toexitabovethetopdirectory.Description:Anunhandledexceptionoccurredduringtheexecutionofthecurrentwebrequest.Pleaserevi

报错-这个Struts2错误是怎么回事啊?

问题描述 这个Struts2错误是怎么回事啊? 12:45:29,624 ERROR ParametersInterceptor:34 - Developer Notification (set struts.devMode to false to disable this message): Unexpected Exception caught setting 'police.id' on 'class yh.position.action.center.PoliceUpdateAction

哪位高手帮帮忙? JSP+TOMCAT 报错HTTP Status 500

问题描述 HTTPStatus500---------------------------------------------------------------------------------typeExceptionreportmessagedescriptionTheserverencounteredaninternalerror()thatpreventeditfromfulfillingthisrequest.exceptionjava.lang.NullPointerExcept

Windows下安装Symfony2报错PHP accelerator错误

在windows下安装symfony2,打开入口路由http://localhost/symfony2/web/config.php配置时报错 1.Install and/or enable a PHP accelerator (highly recommended). 意思是:安装或使用一个PHP加速器(强烈建议) 其实在php5.5已经集成Zend Opcache功能,以前一般用APC,但是在PHP5.5以后都用Opcache代替,缓存速度比APC更快.Zend Opcache的扩展dll文

eclipse3.6启动报错,附错误日志!

问题描述 错误日志如下,刚下的eclipse3.6,jdk装的是1.6.0.22!SESSION2010-11-0511:46:31.593-----------------------------------------------eclipse.buildId=M20100909-0800java.version=1.3.1_01java.vendor=SunMicrosystemsInc.BootLoaderconstants:OS=win32,ARCH=x86,WS=win32,NL=z