Board logo

标题: ASP连接MSSQL [打印本页]

作者: 电子工匠    时间: 2011-2-12 09:37     标题: ASP连接MSSQL

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%>




欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) Powered by Discuz! 7.0.0