高手帮我看看这段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 广告
随着AI技术的飞速发展,如今市面上涌现了许多实用易操作的AI生成工具1、简介:AiPPT: 这款AI工具智能理解用户输入的主题,提供“AI智能生成”和“导入本地大纲”的选项,生成的PPT内容丰富多样,可自由编辑和添加元素,图表类型包括柱状图...
点击进入详情页
本回答由AiPPT提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询