数据库是不是连接不上虚拟主机,帮我看看下面的ASP代码有问题吗? 55
<%@LANGUAGE=VBScriptCodePage=936%><%Response.Buffer=trueDimConn,ConnStr'ConnStr="Prov...
<%@ LANGUAGE = VBScript CodePage = 936%>
<%
Response.Buffer = true
Dim Conn,ConnStr
'ConnStr = "Provider = SQLNCLI.1; User ID = " & SqlUsername & "; Password = " & SqlPassword & "; Initial Catalog = " & SqlDatabaseName & "; Data Source = " & SqlLocalName & ";"
ConnStr = "driver={SQL Server};database=帐号名;Server=IP地址;uid=账号;pwd=密码"
'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
'-----------------------------------------------------------------------------------------------------
'-----------------------------------------------------------------------------------------------------
%>
<%
Dim flashack_Post,flashack_Get,flashack_In,flashack_Inf,flashack_Xh,flashack_db,flashack_dbstr
flashack_In = "'※ and※ exec※ insert※ select※ delete※ update※ count※ chr※ mid※ master※ truncate※ char※ declare"
flashack_Inf = split(flashack_In,"※")
If Request.Form<>"" Then
For Each flashack_Post In Request.Form
For flashack_Xh=0 To Ubound(flashack_Inf)
If Instr(LCase(Request.Form(flashack_Post)),flashack_Inf(flashack_Xh))<>0 Then
Response.Write "<Script Language=JavaScript>alert('请不要在参数中包含非法字符尝试注入!');</Script>"
Response.Write "非法操作!系统做了如下记录↓<br>"
Response.Write "操作IP:"&Request.ServerVariables("REMOTE_ADDR")&"<br>"
Response.Write "操作时间:"&Now&"<br>"
Response.Write "操作页面:"&Request.ServerVariables("URL")&"<br>"
Response.Write "提交方式:POST<br>"
Response.Write "提交参数:"&flashack_Post&"<br>"
Response.Write "提交数据:"&Request.Form(flashack_Post)
Response.End
End If
Next
Next
End If
If Request.QueryString<>"" Then
For Each flashack_Get In Request.QueryString
For flashack_Xh=0 To Ubound(flashack_Inf)
If Instr(LCase(Request.QueryString(flashack_Get)),flashack_Inf(flashack_Xh))<>0 Then
Response.Write "<Script Language=JavaScript>alert('请不要在参数中包含非法字符尝试注入!');</Script>"
Response.Write "非法操作!系统做了如下记录↓<br>"
Response.Write "操作IP:"&Request.ServerVariables("REMOTE_ADDR")&"<br>"
Response.Write "操作时间:"&Now&"<br>"
Response.Write "操作页面:"&Request.ServerVariables("URL")&"<br>"
Response.Write "提交方式:GET<br>"
Response.Write "提交参数:"&flashack_Get&"<br>"
Response.Write "提交数据:"&Request.QueryString(flashack_Get)
Response.End
End If
Next
Next
End If
%>
上面的
ConnStr = "driver={SQL Server};database=帐号名;Server=IP地址;uid=账号;pwd=密码"
这里应该别错? 展开
<%
Response.Buffer = true
Dim Conn,ConnStr
'ConnStr = "Provider = SQLNCLI.1; User ID = " & SqlUsername & "; Password = " & SqlPassword & "; Initial Catalog = " & SqlDatabaseName & "; Data Source = " & SqlLocalName & ";"
ConnStr = "driver={SQL Server};database=帐号名;Server=IP地址;uid=账号;pwd=密码"
'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
'-----------------------------------------------------------------------------------------------------
'-----------------------------------------------------------------------------------------------------
%>
<%
Dim flashack_Post,flashack_Get,flashack_In,flashack_Inf,flashack_Xh,flashack_db,flashack_dbstr
flashack_In = "'※ and※ exec※ insert※ select※ delete※ update※ count※ chr※ mid※ master※ truncate※ char※ declare"
flashack_Inf = split(flashack_In,"※")
If Request.Form<>"" Then
For Each flashack_Post In Request.Form
For flashack_Xh=0 To Ubound(flashack_Inf)
If Instr(LCase(Request.Form(flashack_Post)),flashack_Inf(flashack_Xh))<>0 Then
Response.Write "<Script Language=JavaScript>alert('请不要在参数中包含非法字符尝试注入!');</Script>"
Response.Write "非法操作!系统做了如下记录↓<br>"
Response.Write "操作IP:"&Request.ServerVariables("REMOTE_ADDR")&"<br>"
Response.Write "操作时间:"&Now&"<br>"
Response.Write "操作页面:"&Request.ServerVariables("URL")&"<br>"
Response.Write "提交方式:POST<br>"
Response.Write "提交参数:"&flashack_Post&"<br>"
Response.Write "提交数据:"&Request.Form(flashack_Post)
Response.End
End If
Next
Next
End If
If Request.QueryString<>"" Then
For Each flashack_Get In Request.QueryString
For flashack_Xh=0 To Ubound(flashack_Inf)
If Instr(LCase(Request.QueryString(flashack_Get)),flashack_Inf(flashack_Xh))<>0 Then
Response.Write "<Script Language=JavaScript>alert('请不要在参数中包含非法字符尝试注入!');</Script>"
Response.Write "非法操作!系统做了如下记录↓<br>"
Response.Write "操作IP:"&Request.ServerVariables("REMOTE_ADDR")&"<br>"
Response.Write "操作时间:"&Now&"<br>"
Response.Write "操作页面:"&Request.ServerVariables("URL")&"<br>"
Response.Write "提交方式:GET<br>"
Response.Write "提交参数:"&flashack_Get&"<br>"
Response.Write "提交数据:"&Request.QueryString(flashack_Get)
Response.End
End If
Next
Next
End If
%>
上面的
ConnStr = "driver={SQL Server};database=帐号名;Server=IP地址;uid=账号;pwd=密码"
这里应该别错? 展开
3个回答
展开全部
找客服问一下吧。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
您需要找专业人员帮您解决
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
详细错误提示呢???
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询