ASP连接MSSQL
<%CmdId=request("CmdId")%>
<%SetSeverIp=request("SetSeverIp")%>
<%SetSeverLab=request("SetSeverLab")%>
<%SetSeverNa=request("SetSeverNa")%>
<%SetSeverPw=request("SetSeverPw")%>
<%if CmdId=101 then%>
<%response.s("GRD")("SetSeverIp")=request("SetSeverIp")%>
<%response.s("GRD")("SetSeverLab")=request("SetSeverLab")%>
<%response.s("GRD")("SetSeverNa")=request("SetSeverNa")%>
<%response.s("GRD")("SetSeverPw")=request("SetSeverPw")%>
<%if SetSeverIp="" then%>
<%response.s("GRD")("SetSever")=0%>
<%else%>
<%response.s("GRD")("SetSever")=1%>
<%end if%>
<%if SetSeverLab="" then%>
<%response.s("GRD")("SetSever")=0%>
<%else%>
<%response.s("GRD")("SetSever")=1%>
<%end if%>
<%if SetSeverNa="" then%>
<%response.s("GRD")("SetSever")=0%>
<%else%>
<%response.s("GRD")("SetSever")=1%>
<%end if%>
<%end if%>
< http-equiv="refresh" content="0;URL=DEFAULT.asp">
<%Server.Timeout = 1000 %>
<%if request.s("GRD")("SetSever")=1 then%>
<%SetSeverIp=request.s("GRD")("SetSeverIp")%>
<%SetSeverLab=request.s("GRD")("SetSeverLab")%>
<%SetSeverNa=request.s("GRD")("SetSeverNa")%>
<%SetSeverPw=request.s("GRD")("SetSeverPw")%>
<%
sqlopendb="driver={sql server};database="&SetSeverLab&";server="&SetSeverIp&";uid="&SetSeverNa&";pwd="&SetSeverPw&""
Set conn = Server.CreateObject("ADODB.Connection")
conn.open(sqlopendb)
%>
<%else%>
<%end if%> |