查看: 3067|回复: 1

[问与答] 怎么在asp中判断数据库有没有这个字段名称

[复制链接]
远程 发表于 2016-1-12 10:54:31 | 显示全部楼层 |阅读模式
sub sysclass(parentid,classid)


if classid>0 then
myid=classid
else
myid=getparentid(sf_classid)
end if

if parentid=0 then
myid=getparentid(23)
else
myid=getparentid(sf_classid)
end if
response.write "<ul>"
sql="SELECT * from webclass where  ismenu=true and parentid="&myid

set frs=server.createobject("adodb.recordset")

frs.open sql,oconn,1,1

do while not frs.eof

response.write "<li><a href='webcontent.asp?classid="&frs("id")&"&modid="&frs("modid")&"&parentid="&frs("parentid")&"'>"&frs("classname")&"</a></li>"

frs.movenext

loop

frs.close

set frs=nothing

response.write "</ul>"

end sub

我想再加一个判断,如果数据库中没有parentid这个字段的判断
xuanxiao 发表于 2016-2-5 00:25:48 | 显示全部楼层
你是想实现一个什么逻辑。分类调用?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表

在线客服

售前咨询
售后咨询
服务热线
023-58418553
微信公众号