何在asp中把支持数据库的字段中存放的htmL代码显示出来

shranker 2005-07-15 05:25:35
在数据库字段中存放表格及数据的html代码,读出来时asp应该先将其解释成html,然后发送到浏览器,不知怎么回事,我却一直不成功?
...全文
98 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
白夜花寒 2005-07-15
  • 打赏
  • 举报
回复
class cls_adox
dim the_adox
Private Sub Class_Initialize
set the_adox=createobject("ADOX.Catalog")
end sub

public sub sqlserver_getactiveconnection(dsource,dbasename,uid,pwd)
the_adox.ActiveConnection="Provider=sqloledb;Data Source=" & dsource & ";Initial Catalog=" & dbasename & ";User ID=" & uid & ";PWD=" & pwd & ";"

end sub

public sub access_getactiveconnection(theaccessfile)
the_adox.ActiveConnection="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & theaccessfile
end sub

public sub create_mdb(DBPath)
the_adox.Create "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DBPath
end sub

public sub create_table(tablename,fieldnames,types)
Set tbl = createobject("ADOX.Table")
tbl.Name = tablename
for i=0 to ubound(fieldnames)-1
tbl.Columns.Append fieldnames(i), types(fieldnames(i))
next
the_adox.Tables.Append tbl
set tbl=nothing
end sub

public function tablename
dim a()
dim i : i=1
for each objtab in the_adox.tables
if objtab.type="TABLE" then
redim Preserve a(i)
a(i-1)=objtab.name
' alert(objtab.type)
i=i+1
end if
next

tablename=a
end function

public function getfieldinfo(thetabname)
dim a()
set thetableadox=the_adox.tables.item(thetabname)
for i=0 to thetableadox.columns.count-1
set ttt=createobject("scripting.dictionary")
redim preserve a(i+1)
' alert(thetableadox.columns.Item(i).type)
ttt.add "name",thetableadox.columns.Item(i).name
ttt.add "type",thetableadox.columns.Item(i).type
set a(i)=ttt
set ttt=nothing
next
' alert(isArray(a))
getfieldinfo=a
end function

Private Sub Class_Terminate
set the_adox=nothing
End Sub

end class
wzhiyuan 2005-07-15
  • 打赏
  • 举报
回复
通常可以直接发的。
这个,response.write "<!-- #include file = 'function.asp' -->"
我也不知道怎么办,关注一下。
ksn520 2005-07-15
  • 打赏
  • 举报
回复
response.write rs("字段"),这样就能成功了啊
hebhd 2005-07-15
  • 打赏
  • 举报
回复
我从来没有试成过 response.write "<!-- #include file = 'function.asp' -->" 成功的执行过呢

你需要将代码贴出来才能帮你看嘛
shranker 2005-07-15
  • 打赏
  • 举报
回复
access
pretyboy 2005-07-15
  • 打赏
  • 举报
回复
这要看你采用的何种数据库了,采用的了段是何种格式了,如果是文本格式的话,应该不会有问题,
不过你可以将你的数据库该字段的设定发上来看一下。




网诚天下科技
http://www.nswt.net
QQ:453849004

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧