注册 | 登录
收藏 | 帮助
热门文章
编辑推荐
相关文章  
Win XP中震荡波后应采取的措施
Win 2000防毒从安装系统时开始
Win XP SP2拖放IE窗口可能引发黑
Linux系统下的病毒发展及其分类
用WinRAR解析木马病毒的捆绑原理
识破用WinRAR捆绑的木马
走近 WSH(Windows Scripting Hos
利用Windows控制台删除无法删除的
用Windows自带工具打造“免检”木
从Melissa到Zotob:Windows蠕虫1
您现在的位置: 顶尖设计 >> IT学院 >> 数据库 >> MS SQL >> 文章正文
win98+PWS环境下连接读取远程SQLServer
作者:佚名  来源:不详  点击:  更新:2006-12-20
简介:
from: http://www.planet-source-code.com/vb/scripts/ShowCode.asp?lngWId=4&txtCodeId=6518
Connect/Read Remote SQL server Using PWS in win 98


     I had to test Microsoft's Personal Webserver (PWS) in win 98 to access Remote SQL server 7.0
installed in a NT server. The clients to win 98 had LAN connections. Easy one , don't vote, have fun with
PWS. In fact I tested my connection with this script, before I created an out of process server demo with
VB.



  
  

code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!


Terms of Agreement:   
By using this code, you agree to the following terms...   
1) You may use this code in your own programs (and may compile it into a program and distribute it in
compiled format for langauges that allow it) freely and with no charge.   
2) You MAY NOT redistribute this code (for example to a web site) without written permission from the
original author. Failure to do so is a violation of copyright laws.   
3) You may link to this code from another website, but ONLY if it is not wrapped in a frame.
4) You will abide by any additional copyright restrictions which the author may have placed in the code or
code's description.  


    '**************************************
    ' Name: Connect/Read Remote SQL server U
    '     sing PWS in win 98
    ' Description:I had to test Microsoft's
    '     Personal Webserver (PWS) in win 98 to ac
    '     cess Remote SQL server 7.0 installed in
    '     a NT server. The clients to win 98 had L
    '     AN connections. Easy one , don't vote, h
    '     ave fun with PWS. In fact I tested my co
    '     nnection with this script, before I crea
    '     ted an out of process server demo with V
    '     B.
    ' By: Manas Mukherjee
    '
    ' Assumes:Knowing Little bit of LAN woul
    '     d help , VPN, HTML, Creating Virtual dir
    '     ectory with PWS
    '
    'This code is copyrighted and has    ' limited warranties.Please see http://w
    '     ww.Planet-Source-Code.com/xq/ASP/txtCode
    '     Id.6518/lngWId.4/qx/vb/scripts/ShowCode.
    '     htm    'for details.    '**************************************
    
    <HTML><HEAD>
    <TITLE> ASP_PUBS/SQL Server In NT server</TITLE>
    </HEAD>
    <BODY><CENTER>
    <%
    Dim objConn, objRS, strQ, strOut, I
    Set objConn = Server.CreateObject("ADODB.Connection")
    objConn.open "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial
Catalog=pubs;Data Source=\URServerName"
    Set objRS = Server.CreateObject("ADODB.Recordset")
    strQ = "SELECT emp_id, fname, lname,job_id "
    strQ = strQ & "FROM Employee "
    objRS.Open strQ, objConn, , , adCmdText
    %>
    <TABLE BORDER=1 CELLPADDING=4>
    Connected To the Database Pubs
    using connect String "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial
Catalog=pubs;Data Source=\URServername"
    <TH> "EmployeeID" </TH>
    <TH> "FirstName" </TH>
    <TH> "LastName" </TH>
    <TH> "job_id" </TH>
    <% Do While Not objRS.EOF %> <TR>
    <TD> <% = objRS("emp_id") %>
    <TD> <% = objRS("fname") %>
    <TD> <% = objRS("lname") %></TR>
    <TD> <% = objRS("job_id") %></TR>
    <% objRS.MoveNext %>
    <% Loop %>
    <% objRS.Close %>
    <% Set objRS = Nothing %>
    <% Set objConn = Nothing %>
    </TABLE>
    </CENTER>
    </BODY>
    </HTML>




  • 上一篇文章:
  • 下一篇文章:
  • 分享此文:该页面添加到 Mister Wong 添加到雅虎Yahoo!收藏 Add to:Del.icio.us Post to Furl Digg this 添加到Google书签 reddit spurl blogmarks 365Key 评论  收藏  分享  打印
     我来说两句
    姓名:       验证码:   
    主页: 
    评分: 1分 2分 3分 4分 5分
    本频道近期热评文章:
      关于我们 | 联系我们 | 站点地图 | 广告投放 | 友情链接 | 在线留言 | 版权申明
    版权所有 © 2004-2007 顶尖设计(bobd.cn)
    未经授权禁止转载,摘编,复制本站内容或建立镜像. 沪ICP备07504942号 
    网络110
    报警服务