asp替换内容代码,出问题了不知问题出在哪里。谢谢100分献上

来源:百度知道 编辑:UC知道 时间:2024/05/11 13:11:14
<%
'On Error Resume Next
response.expires=0 '要求缓存为0
yuan111=request.Form(yuan)

dbpath = "/asp/Database1.mdb"
ConnStr = "Provider = Microsoft.Jet.OLEDB.4.0;Data Source = " & Server.Mappath(dbpath)
Set conn=Server.CreateObject("ADODB.Connection")
conn.open ConnStr

Set rs=conn.Execute("select orignial, replaceword From table001")

while(not rs.eof)
{
original001=rs("original")
replaceword001=rs("replaceword")

jieguo=replace(yuan111,original001, replaceword001)

rs.movenext
}
response.Write(jieguo&"youarethebest")
%>

我的大哥,你写的是vbscript还是JavaScript ,你的while用法问题!

while()
{

}是JavaScript

replace() 是 vbScript你写的应该是vbScript吧!

把while 改成:

while not rs.eof

original001=rs("original")
replaceword001=rs("replaceword")

jieguo=replace(yuan111,original001, replaceword001)

rs.movenext
wEnd

yuan111=request.Form("yuan")