你这个是数据库连接错误.导致无法访问.我给你我平时写的代码.你参照一下.不动的跟我联系.QQ:308046190.
我的QQ群:31758718
<%
'SQL防注入函数
'SQL_injdata= "'|and|exec|insert|select|delete|update|count|%|chr|mid|master|truncate|char|declare|--"
'SQL_inj = split(SQL_Injdata,"|")
'If Request.QueryString <> "" Then
'For Each SQL_Get In Request.QueryString
' For SQL_Data=0 To Ubound(SQL_inj)
' if instr(Request.QueryString(SQL_Get),Sql_Inj(Sql_DATA))>0 Then
'Response.Write "<Script Language=javascript>alert('参数错误!');history.back(-1);"
'Response.end
'end if
'next
' Next
'End If
'If Request.Form<>"" Then
'For Each Sql_Post In Request.Form
' For SQL_Data=0 To Ubound(SQL_inj)
' if instr(Request.Form(Sql_Post),Sql_Inj(Sql_DATA))>0 Then
' Response.Write "<Script Language=javascript>history.back(-1);"
' Response.end
' end if
'next
' next
'end if
set conn=server.createobject("ADODB.Connection")
on error resume next
connstr="driver={SQL Server};server=192.168.1.30;uid=sa;pwd=fjkj;database=CanLian"
conn.open connstr
if err<>0 then
response.write "打开数据库失败,请与管理员联系!"
response.end
end if
sub CloseConn()
conn.close
set conn=nothing
end sub
on error goto 0
%>
第二个问题的解答:
<%
'SQL防注入函数
'SQL_injdata= "'|and|exec|insert|select|delete|update|count|%|chr|mid|master|truncate|char|declare|--"
'SQL_inj = split(SQL_Injdata,"|")
'If Request.QueryString <> "" Then
'For Each SQL_Get In Request.QueryString
' For SQL_Data=0 To Ubound(SQL_inj)
' if instr(Request.QueryString(SQL_Get),Sql_Inj(Sql_DATA))>0 Then
'Response.Write "<Script Language=javascript>alert('参数错误!');history.back(-1);"
'Response.end
'end if
'next
' Next
'End If
'If Request.Form<>"" Then
'For Each Sql_Post In Request.Form
' For SQL_Data=0 To Ubound(SQL_inj)
' if instr(Request.Form(Sql_Post),Sql_Inj(Sql_DATA))>0 Then
' Response.Write "<Script Language=javascript>history.back(-1);"
' Response.end
' end if
'next
' next
'end if
set conn=server.createobject("ADODB.Connection")
on error resume next
connstr="driver={SQL Server};server=192.168.1.30;uid=sa;pwd=fjkj;database=CanLian"
conn.open connstr
if err<>0 then
response.write "打开数据库失败,请与管理员联系!"
response.end
end if
sub CloseConn()
conn.close
set conn=nothing
end sub
on error goto 0
%>
第二个问题的解答:
WIN2003的系统安全性比较高.你可以在"internet选项"中设置.如果还不能点开,那说明他这个文件可能有问题。你必须得查查他这个文件.