高手帮我看看这段ASP代码哪里错了
<%db="wenzhang.mdb"Setconn=Server.CreateObject("ADODB.Connection")connstr="driver={Mi...
<%db="wenzhang.mdb"
Set conn = Server.CreateObject("ADODB.Connection")
connstr="driver={Microsoft Access Driver (*.mdb)};dbq=" & Server.MapPath(db)
conn.Open connstr
%>
<%
Function UBB(content)
If IsNull(content) Then Exit Function
strTmp = trim(content)
Set oReg = New Regexp
oReg.Ignorecase = True
oReg.Global = True
oReg.Pattern="(\[wen_)(.[^\[]*)(\_)(.[^\[]*)(\_)(.[^\[]*)(\_)(\])"
strTmp=oReg.Replace(strTmp,""& wenSub($2,$4",$6) &"")
Set oReg = Nothing
UBB=strTmp
End Function
Function wenSub(Number,Number1,Number2)
If IsNull(wenSub) Then Exit Function
Dim UbbContent
on error resume next
set rs = server.createobject("adodb.recordset")
Sql="SELECT top 10 * From wz Order By ID desc"
rs.open sql,conn,1,1
if not (rs.bof and rs.eof) then
for n=1 to ""&cstr(Number1)&""
if n mod 3=0 then
UbbContent = UbbContent & Left(Rs("bt"), Number2) &"<br/>"
else
UbbContent = UbbContent & Left(Rs("bt"), Number2) &""
end if
if rs.eof then
exit for
else
rs.movenext
end if
next
else
UbbContent = "暂时没有文章!"
end if
rs.close
set rs=nothing
wenSub = UbbContent
End Function
%>
提示无效字符
/xt/ce/wz.asp,行 46
strTmp=oReg.Replace(strTmp,""& wenSub($2,$4,$6) &"")。。我换了很多次还是不行!主要是调用数据库的数据! 展开
Set conn = Server.CreateObject("ADODB.Connection")
connstr="driver={Microsoft Access Driver (*.mdb)};dbq=" & Server.MapPath(db)
conn.Open connstr
%>
<%
Function UBB(content)
If IsNull(content) Then Exit Function
strTmp = trim(content)
Set oReg = New Regexp
oReg.Ignorecase = True
oReg.Global = True
oReg.Pattern="(\[wen_)(.[^\[]*)(\_)(.[^\[]*)(\_)(.[^\[]*)(\_)(\])"
strTmp=oReg.Replace(strTmp,""& wenSub($2,$4",$6) &"")
Set oReg = Nothing
UBB=strTmp
End Function
Function wenSub(Number,Number1,Number2)
If IsNull(wenSub) Then Exit Function
Dim UbbContent
on error resume next
set rs = server.createobject("adodb.recordset")
Sql="SELECT top 10 * From wz Order By ID desc"
rs.open sql,conn,1,1
if not (rs.bof and rs.eof) then
for n=1 to ""&cstr(Number1)&""
if n mod 3=0 then
UbbContent = UbbContent & Left(Rs("bt"), Number2) &"<br/>"
else
UbbContent = UbbContent & Left(Rs("bt"), Number2) &""
end if
if rs.eof then
exit for
else
rs.movenext
end if
next
else
UbbContent = "暂时没有文章!"
end if
rs.close
set rs=nothing
wenSub = UbbContent
End Function
%>
提示无效字符
/xt/ce/wz.asp,行 46
strTmp=oReg.Replace(strTmp,""& wenSub($2,$4,$6) &"")。。我换了很多次还是不行!主要是调用数据库的数据! 展开
1个回答
展开全部
先单独运行
wenSub(Number,Number1,Number2)
这个看看,看能否正确输出值,如果正确,就是
strTmp=oReg.Replace(strTmp,""& wenSub($2,$4,$6) &"")这行的问题
wenSub(Number,Number1,Number2)
这个看看,看能否正确输出值,如果正确,就是
strTmp=oReg.Replace(strTmp,""& wenSub($2,$4,$6) &"")这行的问题
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
AiPPT
2024-09-19 广告
2024-09-19 广告
作为北京饼干科技有限公司的工作人员,关于AIPPT免费生成PPT的功能,我可以简要介绍如下:AIPPT是一款基于人工智能技术的PPT制作工具,它为用户提供了免费生成PPT的便捷服务。用户只需简单输入PPT的主题或内容大纲,AIPPT便能智能...
点击进入详情页
本回答由AiPPT提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询