a高手请进在线等待,网页间参数传递 急急急~~!!!

qfacy 2004-04-07 12:28:32
最终目标
书名 编号 修改
111 book-10-20-210 submit
222 book-10-20-211 submit
.... ............. ......
点击submit的时候传递相对编号的值,而我写的程序在传递参数getmethod_input 时候出现
book-10-20-210 book-10-20-21...........说明我的参数传递错误,不知道那里出现了错误,怎么解决,没有有更简便的方法实现这个!小第在此先谢谢大家了
查询数目文件如下
<!-- #include file="../db/database_connection.asp" -->
<%
'Check the Session("strID")



Sub OrderList()
'Exact the order list
Dim rsOrder 'as New ADODB.Recordset
Set rsOrder=Server.CreateObject("ADODB.Recordset")
Dim strSql 'as String
strSql="select * from tbl_book "
rsOrder.Open strSql,m_con,3,3
if rsOrder.RecordCount>0 then

%>
<table width="1015" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="973" height="54"></td>
<td width="42"></td>
</tr>
<tr>
<td valign="top" height="82">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="22" width="388" valign="top">
<div align="left">书名</div>
</td>
<td valign="top" width="257">
<div align="left">编号</div>
</td>
<td width="328" valign="top">
<p align="left">修改</p>
</td>
</tr>
<%getmethod_input=1%>
<%
while not rsOrder.BOF and not rsOrder.EOF
%><Form Action="updatebook.asp" Method="post">
<tr>
<td height="19">
<td rowspan="2" valign="top">

<input type="text" name=getmethod_input size="50" value="<% =rsOrder("strID") %>">

</td>
<td rowspan="2" valign="top">

<% Response.Write "<input type=submit name=cmdUpdateOrder value=""修改"">"
%>
</td>

<tr>
<td height="30" valign="top"> <%=rsorder("strChineseName")%> </td>

</tr>
</from>

<%
rsOrder.MoveNext
wend
%>
</table>
</td>
</tr>
</table>
<%
end if
rsOrder.Close
Set rsOrder=Nothing
end sub
%>
<html>
<head>
<title>无标题文档</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>

<body bgcolor="#FFFFFF" text="#000000">
<% OrderList %>

</body>
</html>

下一页
<%
dim pidef
pidef=Request("getmethod_input")
response.write pidef
%>
html>
<head>
<title>无标题文档</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>

<body bgcolor="#FFFFFF" text="#000000">
略......
......

</body>
</html>
...全文
92 点赞 收藏 17
写回复
17 条回复
切换为时间正序
请发表友善的回复…
发表回复
qfacy 2004-04-10
还有其他的数字吗?我是个菜鸟·!
请高手指教
回复
qfacy 2004-04-10
rsOrder.Open strSql,m_con,1,3
rsOrder.Open strSql,m_con,3,1
rsOrder.Open strSql,m_con,3,3
后面的数字1,3
3,1
3,3
他们分别代表什么意思?
回复
xieyj 2004-04-07
上面说错了,重新看了一下你是生成了多个名为 getmethod_input 的文本框,读到的是一个数组,可以使用 split(,) 函数将它分隔
回复
xieyj 2004-04-07
<input type="text" name=getmethod_input size="50" value="<% =rsOrder("strID") %>">
的值显示的是什么传递过来就是什么
回复
evice 2004-04-07
rsProduct.Open "select * from tbl_book where strID='" & pidef &"'",m_con,1,1
加上单引号。
回复
dl2007 2004-04-07
rsProduct.Open "select * from tbl_book where strID="&pidef,m_con,3,3
回复
tlane 2004-04-07
重新启动服务,清除本机上的Cookies.
如果还有问题的话,就确定一下你的strID的类型。
再有这样看是否OK
rsProduct.Open "select * from tbl_book where strID="&pidef,m_con,1,3
回复
qfacy 2004-04-07
还是刚才哪个错误!

回复
tlane 2004-04-07
应该这样写:
rsProduct.Open "select * from tbl_book where strID="&pidef,m_con,1,1
回复
qfacy 2004-04-07
没有,我点submit的时候下一页我写个
<%
dim pidef
pidef=Request("bookid")
Response.Write pidef
%>语句,显示的对,但是运行到rsProduct.Open "select * from tbl_book where strID=pidef",m_con,1,1这行时出现
Microsoft OLE DB Provider for ODBC Drivers 错误 '80040e21'

ODBC 驱动程序不支持所需的属性。

/bat/admin/updatebook.asp,行120
回复
是不是你的所有submit都在一个form中提交的时候把所有的都一起提交了,自己看看是不是这样的毛病~
回复
evice 2004-04-07
<input type=submit name=getmethod_input size="50" value="<% =rsOrder("strID") %>">

把文本框改成按钮就行了。或者,如“baby21st(流浪的脚)”所说。
回复
qfacy 2004-04-07
<tr>
<td width="84">
<div align="right">出版商网址: </div>
</td>
<td width="217">
<input type=text name=txtPublisherUrl size=20 value="<% =rsProduct("strPublisherUrl") %>">
</td>
<td width="130">
<div align="right">折扣数/一元商品:</div>
</td>
<td width="301">
<select name=selDiscount id=selDiscount>
<option value="<% =rsProduct("intDiscount") %>" selected><% =rsProduct("intDiscount")/10 %></option>
<option value="100">无折扣</option>
<option value="95">9.5</option>
<option value="90">9.0</option>
<option value="85">8.5</option>
<option value="80">8.0</option>
<option value="75">7.5</option>
<option value="70">7.0</option>
<option value="65">6.5</option>
<option value="60">6.0</option>
<option value="55">5.5</option>
<option value="50">5.0</option>
<option value="45">4.5</option>
<option value="40">4.0</option>
<option value="35">3.5</option>
<option value="30">3.0</option>
<option value="25">2.5</option>
<option value="20">2.0</option>
<option value="15">1.5</option>
<option value="10">1.0</option>
<option value="0">一元商品</option>
</select>
 持卡会员价:
<input type=text name=txtMumberPrice id=txtMumberPrice size="10" value="<% =rsProduct("curMumberPrice") %>">
元 </td>
</tr>
<tr>
<td width="84">
<div align="right">出版商地址(包含邮编):</div>
</td>
<td width="217">
<input type=text name=txtPublisherAddress size=20 value="<% =rsProduct("strPublisherAddress") %>">
</td>
<td width="130">
<div align="right">中文名: </div>
</td>
<td width="301">
<input type=text name=txtChineseName size=20 value="<% =rsProduct("strChineseName") %>">
</td>
</tr>
<tr>
<td width="84">
<div align="right">发行商: </div>
</td>
<td width="217">
<input type=text name=txtIssuer size=20 value="<% =rsProduct("strIssuer") %>">
</td>
<td width="130">
<div align="right">英文名:</div>
</td>
<td width="301">
<input type=text name=txtEnglishName size=20 value="<% =rsProduct("strEnglishName") %>">
</td>
</tr>
<tr>
<td width="84">
<div align="right">开本: </div>
</td>
<td width="217">
<input type=text name=txtFormat size=20 value="<% =rsProduct("strFormat") %>">
</td>
<td width="130">
<div align="right">作者(原著): </div>
</td>
<td width="301">
<input type=text name=txtAuthor size="20" value="<% =rsProduct("strAuthor") %>">
</td>
</tr>
<tr>
<td width="84">
<div align="right">字数: </div>
</td>
<td width="217">
<input type=text name=txtWordCount size=10 value="<% =rsProduct("intWordCount")\1000 %>">
千字 </td>
<td width="130">
<div align="right">译者: </div>
</td>
<td width="301">
<input type=text name=txtTranslator size="20" value="<% =rsProduct("strTranslator") %>">
</td>
</tr>
<tr>
<td width="84">
<div align="right">版次: </div>
</td>
<td width="217">
<input type=text name=txtBookTime size=20 value="<% =rsProduct("strBookTime") %>">
</td>
<td colspan="2" rowspan="8" valign="top">简介:<br>
<textarea name=txtIntroduction rows=10 cols=60><% =rsProduct("strIntroduction") %></textarea>
</td>
<tr>
<td width="84">
<div align="right">书号(ISBN): </div>
</td>
<td width="217">
<input type=text name=txtBookID size="20" value="<% =rsProduct("strBookID") %>">
</td>
</tr>
<tr>
<td width="84">
<div align="right"></div>
</td>
<td width="217">  </td>
</tr>
<tr>
<td width="84">
<div align="right"></div>
</td>
<td width="217">  </td>
</tr>
<tr>
<td width="84">
<div align="right"></div>
</td>
<td width="217">  </td>
</tr>
<tr>
<td width="84">
<div align="right">书封面图路径(相对于book文件夹): </div>
</td>
<td width="217"> 形如:编号.gif </td>
</tr>
<tr>
<td width="84">
<div align="right">是否缺货: </div>
</td>
<td width="217">
<%
dim str1,str0
if rsProduct("intOOS")>0 then
str1=" checked"
else
str0=" checked"
end if
%>
<input type=radio name=radOOS value="1"<% =str1 %>>

<input type=radio name=radOOS value="0"<% =str0 %>>
是 </td>
</tr>
<tr>
<td colspan=2 align=center>
供货商:
<select name=selProvider>
<option value="<% =rsProduct("strProvider") %>"><% =rsProduct("strProvider") %></option>
<%
Dim rsPlyer
Set rsPlayer=Server.CreateObject("ADODB.Recordset")
rsPlayer.Open "select strName from tbl_provider",m_con,1,1
while not rsPlayer.BOF and not rsPlayer.EOF

%>
<option value="<% =rsPlayer("strName") %>"><% =rsPlayer("strName") %></option>
<%
rsPlayer.MoveNext
wend
rsPlayer.Close
Set rsPlayer=Nothing
%>
</select>
</td>
</tr>
<tr>
<td align=center width="84">
<input type=submit name=cmdSubmit value="执行修改">
</td>
<td align=center width="217">
<input type=reset name=cmdReset value="重新填写">
</td>
<td align=center width="130"> </td>
<td align=center width="301"> </td>
</tr>
</table>
</form>
<%
else
Response.Write "None record found!"
end if
rsProduct.Close
Set rsProduct=Nothing
%>
</div>

</BODY>
</HTML>
后出现
这行rsProduct.Open "select * from tbl_book where strID=pidef",m_con,1,1
出现
Microsoft OLE DB Provider for ODBC Drivers 错误 '80040e21'

ODBC 驱动程序不支持所需的属性。

/bat/admin/updatebook.asp,行120
这是为什么

回复
qfacy 2004-04-07
刚才哪个问题解决了:我在问下
<!-- #include file="../db/database_connection.asp" -->
<%
'check session
if IsNull(Session("admin")) or Session("admin")="" then
Response.Redirect "adminlogin.asp"
end if
%>
<%
'check session("admin")

Function FormatString(strText)
dim strTemp
strTemp="00" & strText
strTemp=Right(strTemp,2)
FormatString=strTemp
End Function




%>

<%
dim pidef
pidef=Request("bookid")
Response.Write pidef
%>


<HTML>
<HEAD>
<META name=VI60_defaultClientScript content=VBScript>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0" charset="gb2312">
<link rel="stylesheet" href="../lib/main.css" type="text/css">
<title>管理员——修改图书信息</title>
<Script language=javascript>
<%
Dim rsData 'as New ADODB.Recordset
Set rsData=Server.CreateObject("ADODB.Recordset")
'检索并存储成数组
rsData.Open "SELECT intID,intTID,strType FROM tbl_particulartype_book ORDER BY intTID,intID",m_con,1,1
if rsData.RecordCount>0 then
dim strJavaScript
dim intNo
intNo=1
strJavaScript=chr(13) & "var subclassno = new Array();" & chr(13) & "var subclassname = new Array();" & chr(13)
do while not rsData.BOF and not rsData.EOF
'on error resume next
strJavaScript=strJavaScript & "subclassno[" & intNo & "]=""" & FormatString(CStr(rsData("intTID"))) & "|" & rsData("intID") & """;" & chr(13)
strJavaScript=strJavaScript & "subclassname[" & intNo & "]=""" & rsData("strType") & """;" & chr(13) & chr(13)
'response.write err.number & "<br>" & err.description
'response.end
rsData.MoveNext
intNo=intNo+1
loop
Response.Write strJavaScript
end if
rsData.Close
set rsData=nothing


%>


function ChangeClass(frmvalue){
//alert(frmvalue);
var j=0;
while(frmAddBook.selParticularType.options.length >=1) {
frmAddBook.selParticularType.options[(frmAddBook.selParticularType.options.length -1)] = null
}
for(var i=1;i<subclassno.length;i++){
if(subclassno[i].substring(0,2) == frmvalue){
frmAddBook.selParticularType.options[j]=new Option(subclassname[i],subclassno[i].substring(3,subclassno[i].length));
j++;
}
}
}
//-->
</Script>

<SCRIPT ID=clientEventHandlersVBS LANGUAGE=vbscript>
<!--

Sub selDiscount_onclick
'change
dim curVip
if frmAddBook.selDiscount.value<>"0" then
curVip=CCur(CCur(frmAddBook.txtOrgPrice.value)*(CSNG(frmAddBook.selDiscount.value)-5)/100)
else
curVip=1
end if
frmAddBook.txtMumberPrice.value=curVip
End Sub

Sub selDiscount_onchange
'selDiscount_onclick
End Sub

Sub txtMumberPrice_onfocus
'selDiscount_onclick
End Sub

-->
</SCRIPT>
</HEAD>
<BODY bgcolor="#FFFFFF">
<center>
<h1>管理员——修改图书信息</h1>
<br>
<h5>请不要胡乱填写,我没加判断 :(</h5>
</center>
<hr>
<div align=center width=750>
<%
'Exact the all products
Dim strErrRpt 'as String
Dim rsProduct 'as New ADODB.Recordset
Set rsProduct=Server.CreateObject("ADODB.Recordset")
'Exact the records where type is "Programming"
rsProduct.Open "select * from tbl_book where strID=pidef",m_con,1,1
if rsProduct.RecordCount>0 then
'
'show top type and detail type
Dim rsTT,rsPT
Dim strTT,strPT
set rsTT=server.CreateObject("adodb.recordset")
set rsPT=server.CreateObject("adodb.recordset")
rsTT.Open "select strType from tbl_toptype_book where intID=" & rsProduct("intTID"),m_con,1,1
if rsTT.RecordCount>0 then
strTT=rsTT("strType")
end if
rsTT.Close
Set rsTT=Nothing
rsPT.Open "select strType from tbl_particulartype_book where intID=" & rsProduct("intPID"),m_con,1,1
if rsPT.RecordCount>0 then
strPT=rsPT("strType")
end if
rsPT.Close
Set rsPT=Nothing

%>
<form action="do_updatebook.asp?pid=<% =request("pid") %>" method=post name=frmAddBook>
<table border=0 class=txt12 bgcolor="#CCCCCC" width="750">
<tr>
<td align=center valign=center bgcolor=Silver colspan=4> 图书信息
</tr>
<tr>
<td width="84">
<div align="right">作者国籍: </div>
</td>
<td width="217">
<input type=text name=txtNation size="20" value="<% =rsProduct("strNation") %>" >
</td>
<td width="130">
<div align="right">详细类属编号</div>
</td>
<td width="301">
<select name=selTopType onChange="return ChangeClass(this.options[this.selectedIndex].value)" size=1>
<option value="<% =rsProduct("intTID") %>" selected><% =strTT %></option>
<option value="">请选择大类</option>
<%
'exact the info from database
dim rsTopType 'as New ADODB.Recordset
set rsTopType=Server.CreateObject("adodb.recordset")
rsTopType.Open "select intID,strType from tbl_toptype_book",m_con,1,1
if rsTopType.RecordCount>0 then
while not rsTopType.BOF and not rsTopType.EOF
%>
<option value="<% =FormatString(CStr(rsTopType("intID"))) %>">
<% =rsTopType("strType") %>
</option>
<%
rsTopType.MoveNext
wend
end if
rsTopType.Close
Set rsTopType=Nothing
%>
</select>
<select name=selParticularType size=1>
<option value="<% =rsProduct("intPID") %>" selected><% =strPT %></option>
<option value="">请选择小类</option>
</select>
</td>
</tr>
<tr>
<td width="84">
<div align="right">出版社: </div>
</td>
<td width="217">
<input type=text name=txtPublisher size=20 value="<% =rsProduct("strPublisher") %>">
</td>
<td width="130">
<div align="right">价格: </div>
</td>
<td width="301">
<input type=text name=txtOrgPrice id=txtOrgPrice size="20" value="<% =rsProduct("curOrgPrice") %>">
元 </td>
</tr>
回复
尚和空四 2004-04-07
<form action="参数">
回复
baby21st 2004-04-07
你submit不是每条记录后面都有吗?
那就不要用form,直接是链接

<a href="updatebook.asp?bookid=<%=bookid%>">submit</a>
回复
qfacy 2004-04-07
getmethod_input文本框200多个,getmethod_input 应该是个数组,怎样我点第一个submit就能准确的判断是book-10-20-210
我不是很明白,请指教
回复
发动态
发帖子
ASP
创建于2007-09-28

2.8w+

社区成员

ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
申请成为版主
社区公告
暂无公告