首页 | 新闻 | 新品 | 文库 | 方案 | 视频 | 下载 | 商城 | 开发板 | 数据中心 | 座谈新版 | 培训 | 工具 | 博客 | 论坛 | 百科 | GEC | 活动 | 主题月 | 电子展
返回列表 回复 发帖

ASP连接MSSQL

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%>
细节决定成败!
返回列表