注册 登录
编程论坛 SQL Server论坛

recordset.open后产生的错误,缺少''

贝裘 发布于 2006-10-28 12:10, 591 次点击

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

错误类型:
Microsoft VBScript 运行时错误 (0x800A01A8)
缺少对象: ''
/asp/wxyweb/modify.asp, 第 32 行
第32行是指下面程序中的蓝色代码.为什么会出这样的错呢?
试过几种改的方案都不行:

1,rst.open" "select*from user where u_id=&" request.querystring("id"),conn,1,1 "
2,rst.open" '"select*from user where u_id="' & request.querystring("id") ,conn,1,1"
3,rst.open" '"select*from user where u_id="' & request.querystring("id")" ,conn,1,1 '
'上面三个就提示,语句未结束
4,rst.open "select*from user where u_id=& request.querystring("id"),conn,1,1 "
5,rst.open '"select*from user where u_id=" & request.querystring("id") ,conn,1,1 '
这两种还是提示缺少对象''


<!-- #include file="db.inc.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>会员资料修改</title>

set rst=server.createobject("adodb.recordset")
<body>
<table width="800" height="573" border="0" align="center" cellspacing="0">
<tr>
<td height="573" align="center" valign="top" background="img/hyzlxg.jpg"><table width="800" border="0" cellspacing="0">
<tr>
<td width="73" height="164"> </td>
<td width="646"> </td>
<td width="75"> </td>
</tr>
<tr>
<td height="337"> </td>
<td align="center" valign="middle" bgcolor="#F9F9F9"><a href="admin.asp">返回会员列表</a>

<%
rst.open "select*from user where u_id=" & request.querystring("id"),conn,1,1
%>

<form id="form1" name="form1" method="post">
<table width="90%" border="1" align="center" cellpadding="5" cellspacing="0">
<tr>
<td colspan="3">请在下面修改会员资料,红色<span class="STYLE1">*</span>号所标示的选项为必填项</td>

请帮忙赶一下这个半路杀出来的老虎.多谢先.

1 回复
#2
贝裘2006-10-28 13:12

我找到宝剑啦.
错在:
set rst=server.createobject("adodb.recordset")
<body>
<table width="800" height="573" border="0" align="center" cellspacing="0">


<body>
set rst=server.createobject("adodb.recordset")
<table width="800" height="573" border="0" align="center" cellspacing="0">

应该改在放在<body>
</body>标签之间,才起作用,而我是放在了<body>前面.看来,这么位置一不小心,就会出现怪怪的错误,错误提示行却是说第32行,
简直头都想大,也想不出来呀.其实我就是想等高手来指点再来想它的.后来再继续写其它功能时,预览却见到有这个行单独的脚码出
现在页面,觉得其怪,才查这一行程序,竟发觉自己把它放在了<body>
</body>标签之外,所以不能达到创建rst这个变量,后来移进去,再改成原来出错的环境,也就是没写其它功能之前的环境,果然错误的情况就这样被解决了,原来是位置问题造成了这个错误的呢.天都光晒:)


1