conn.asp连接数据库如何改成绝对路径?
我的是access数据库··下面是conn.asp文件的代码:-------------------------------------<%//Rem过滤HTML代码fu...
我的是access数据库··下面是conn.asp文件的代码:
-------------------------------------
<%
//Rem 过滤HTML代码
function HTMLEncode(fString)
if not isnull(fString) then
fString = replace(fString, ">", ">")
fString = replace(fString, "<", "<")
fString = Replace(fString, CHR(32), " ")
fString = Replace(fString, CHR(9), " ")
fString = Replace(fString, CHR(34), """)
fString = Replace(fString, CHR(39), "'")
fString = Replace(fString, CHR(13), "")
fString = Replace(fString, CHR(10) & CHR(10), " ")
fString = Replace(fString, CHR(10), " ")
fString=ChkBadWords(fString)
HTMLEncode = fString
end if
end function
//Rem 过滤SQL非法字符
function checkStr(str)
if isnull(str) then
checkStr = ""
exit function
end if
checkStr=replace(str,"'","''")
end function
Const SiteDb = "/data/#access.asp"
//网站数据库址
dim sessionvar
Dim ConnStr
ConnStr = "Provider = Microsoft.Jet.OLEDB.4.0;Data Source = " & Server.MapPath(MyDbPath & SiteDb)
on error resume next
Set conn = Server.CreateObject("ADODB.Connection")
conn.open ConnStr
If Err Then
err.Clear
Set Conn = Nothing
Response.Write "数据库连接出错,请检查连接字串。"
Response.End
End If
sessionvar="admin&^jffsddasf"
%>
---------------------------------------
我想把路径改成:D:\lijing\#access.asp
怎么改? 展开
-------------------------------------
<%
//Rem 过滤HTML代码
function HTMLEncode(fString)
if not isnull(fString) then
fString = replace(fString, ">", ">")
fString = replace(fString, "<", "<")
fString = Replace(fString, CHR(32), " ")
fString = Replace(fString, CHR(9), " ")
fString = Replace(fString, CHR(34), """)
fString = Replace(fString, CHR(39), "'")
fString = Replace(fString, CHR(13), "")
fString = Replace(fString, CHR(10) & CHR(10), " ")
fString = Replace(fString, CHR(10), " ")
fString=ChkBadWords(fString)
HTMLEncode = fString
end if
end function
//Rem 过滤SQL非法字符
function checkStr(str)
if isnull(str) then
checkStr = ""
exit function
end if
checkStr=replace(str,"'","''")
end function
Const SiteDb = "/data/#access.asp"
//网站数据库址
dim sessionvar
Dim ConnStr
ConnStr = "Provider = Microsoft.Jet.OLEDB.4.0;Data Source = " & Server.MapPath(MyDbPath & SiteDb)
on error resume next
Set conn = Server.CreateObject("ADODB.Connection")
conn.open ConnStr
If Err Then
err.Clear
Set Conn = Nothing
Response.Write "数据库连接出错,请检查连接字串。"
Response.End
End If
sessionvar="admin&^jffsddasf"
%>
---------------------------------------
我想把路径改成:D:\lijing\#access.asp
怎么改? 展开
2009-04-10
展开全部
没意个回答对··汗
展开全部
Server.MapPath
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
ConnStr = "Provider = Microsoft.Jet.OLEDB.4.0;Data Source = D:\lijing\#access.asp "
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Server.MapPath("****.mdb")”
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询