|
楼主
<!--#include file="New/Function.asp"-->
<!--#include file="New/Conn.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%= SelectDBName("WebTitle","SystemSet","[id]",1) %></title>
<link href="New/Css.css" rel="stylesheet" type="text/css">
</head>
<body leftmargin="0" topmargin="0">
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td colspan="2"><!--#include file="New/Top.asp" --></td>
</tr>
<tr>
<td width="220" valign="top"><!--#include file="New/Left.asp" --></td>
<td width="540" valign="top" bgcolor="#FFFFFF" class="Td-1">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<%Set Rs=Conn.Execute("Select * from [reColumn] Where id="&Trim(Request.QueryString("id")))%>
<tr>
<td height="30" align="center" background="New/Img/columnTitle.gif"><strong><font color="#FFFFFF">
<%=Rs("Title")%></font></strong></td>
</tr>
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="15">
<tr>
<td><%=Rs("Message")%></td>
</tr>
</table></td>
</tr>
<%Set Rs=Nothing%>
<tr>
<td align="center">
<table width="90%" border="0" cellspacing="0" cellpadding="3">
<%
Set Rs=Conn.Execute("Select * From reColumn Where fID="&Trim(Request.QueryString("id")))
Do While Not Rs.Eof
Set Rs1=Conn.Execute("Select * From reProgram Where cID="&Rs("ID"))
Do While Not Rs1.Eof
%>
<tr>
<td>[<%=Rs("Title")%>]<a href="New/reProgram.asp?id=<%=Rs1("ID")%>"><%=Rs1("Title")%></a></td>
</tr>
<%
Rs1.moveNext
Loop
Set Rs1=Nothing
Rs.moveNext
Loop
Set Rs=Nothing
%>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2"><!--#include file="New/Bottom.asp"--></td>
</tr>
</table>
</body>
</html>
以上是我的原程序
运行也没错误
现在我要把<!--#include file="New/Top.asp" -->
改为<!--#include file="include/Top.asp" -->
而inculde/top.asp是调用的data下的数据库
连接这个数据库的inculde/conn.asp
<%
dim stime,typess
stime=timer()
typess=1
dim conn
dim connst
on error resume next
connst="DBQ="+server.mappath("data/!#%&@$^.asp")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
set conn=server.createobject("ADODB.CONNECTION")
conn.open connst
if session("cffilmuser")="" then
if Request.cookies("gl")("cffilmuser")<>"" then
cffilmuser=Request.cookies("gl")("cffilmuser")
session("cffilmuser")=cffilmuser
end if
if Request.cookies("gl")("cffilmusergrade")<>"" then
cffilmusergrade=Request.cookies("gl")("cffilmusergrade")
session("cffilmusergrade")=cffilmusergrade
end if
name=session("cffilmuser")
else
name=session("cffilmuser")
end if
if session("cffilmadmin")="" then
if Request.cookies("cffilmadmin")<>"" then
cffilmadmin=Request.cookies("cffilmadmin")
session("cffilmadmin")=cffilmadmin
end if
end if
webtitle="东山广播电视网"
%>
而原来那个连接的数据库是远程的
连接数据库的new/conn.asp是
<%
Response.Buffer=True
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 1
Response.cachecontrol = "no-cache"
'on error resume next
dataBaseType=2'数据库类型:1为Acc,2为Sql
Dim ConnStr
If dataBaseType = 2 Then
Dim SqlDatabaseName,SqlPassword,SqlUsername,SqlLocalName
SqlDatabaseName = "dstvdata"
SqlPassword = "11111111"
SqlUsername = "dstvdata"
SqlLocalName = "202.109.237.42"
ConnStr = "Provider = Sqloledb; User ID = " & SqlUsername & "; Password = " & SqlPassword & "; Initial Catalog = " & SqlDatabaseName & "; Data Source = " & SqlLocalName & ";"
Else
Connstr="DBQ="+server.mappath("./MyDataBase/#My#Data#Base#.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
End IF
Set Conn=server.createobject("ADODB.CONNECTION")
Conn.open ConnStr
Response.Write SqlLocalName
%>
怎么改啊 |
|