有问题请问ASP高手,关于源码分析

onlyme920 上海沪仁文化传播有限公司 SEO主管  2004-08-05 03:11:30
我有一“业一新闻系统”,是动态生成HTML的,因为它生成的目录太深,不方便GOOGLE机器人去搜索,我需要生成的HTML文件的文件夹就在根目录下,所以我改了当中的模板转换文件wang_mlist.asp和HTML生成文件wang_cab.asp的路径,原本这两个文件是在同一目录下,将HTML生成文件的位置调整到根目录,数据库连接是对的,但在执行的时候显示的错误的提示如下:



Microsoft OLE DB Provider for ODBC Drivers 错误 '80004005'

[Microsoft][ODBC Microsoft Access Driver]常见错误 不能打开注册表关键字 'Temporary (volatile) Jet DSN for process 0x6e8 Thread 0xac0 DBC 0x2582894 Jet'。

/wang_cab.asp,行16

请问一下是何原因,贴出wang_cab.asp的全部源码

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="news/news/Connections/conn_news.asp" -->
<%
Dim rsn__MMColParam
rsn__MMColParam = "1"
If (Request.Form("t_id") <> "") Then
rsn__MMColParam = Request.Form("t_id")
End If
%>
<%
Dim rsn
Dim rsn_numRows

Set rsn = Server.CreateObject("ADODB.Recordset")
rsn.ActiveConnection =MM_conn_news_STRING
rsn.Source = "SELECT * FROM t_news WHERE n_tid = " + Replace(rsn__MMColParam, "'", "''") + ""
rsn.CursorType = 0
rsn.CursorLocation = 2
rsn.LockType = 1
rsn.Open()

rsn_numRows = 0
%>
<%if rsn.eof and rsn.bof then%>
<script language=javascript>
alert( "该类别没有新闻!" );
location.href = "javascript:history.back()"
</script>
<% Else %>
<%
Dim rsm__MMColParam
do while not rsn.EOF
rsm__MMColParam = "1"
If (Request.Form("m_id") <> "") Then
rsm__MMColParam = Request.Form("m_id")
End If
%>
<%
Dim rsm
Dim rsm_numRows

Set rsm = Server.CreateObject("ADODB.Recordset")
rsm.ActiveConnection = MM_conn_news_STRING
rsm.Source = "SELECT * FROM t_mob WHERE m_id = " + Replace(rsm__MMColParam, "'", "''") + ""
rsm.CursorType = 0
rsm.CursorLocation = 2
rsm.LockType = 1
rsm.Open()

rsm_numRows = 0
pencat = (rsm.Fields.Item("m_content").Value)
%>
<%
dim n_fpath
dim n_title
dim n_author
dim n_content
dim n_date
dim n_fname

n_fpath = request.form("t_id")
n_title = (rsn.Fields.Item("n_title").Value)
n_author = (rsn.Fields.Item("n_author").Value)
n_content = (rsn.Fields.Item("n_content").Value)
n_date = (rsn.Fields.Item("n_date").Value)
n_fname = (rsn.Fields.Item("n_fname").Value)

pencat = replace(pencat,"t_title",n_title)
pencat = replace(pencat,"t_author",n_author)
pencat = replace(pencat,"t_content",n_content)
pencat = replace(pencat,"t_date",n_date)
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set fout = fso.CreateTextFile(server.mappath(n_fpath&"\"&n_fname),true)

fout.WriteLine pencat
fout.close
response.write("转换文件:"&n_fpath&"\"&n_fname&"<br>")
%>
<%
rsm.Close()
Set rsm = Nothing
%>
<%
rsn.MoveNext
loop
rsn.Close()
Set rsn = Nothing
%>
<% End If %>
<script language=javascript>
alert( "模版转换完成" );
location.href = "javascript:history.back()"
</script>

有高手请帮忙
...全文
31 回复 点赞 打赏 收藏 举报
写回复
回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
相关推荐
发帖
ASP
创建于2007-09-28

2.8w+

社区成员

ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
申请成为版主
帖子事件
创建了帖子
2004-08-05 03:11
社区公告
暂无公告