当前位置: 首页 > 图文教程 > 数据库 > MSSQL > 在IE中直接连接SQL数据库

MSSQL
使用SQL Server数据库嵌套子查询的方法
SQL Server SQL Agent服务使用教程小结
五种提高 SQL 性能的方法
非常不错的SQL语句学习手册实例版
SQL语言查询基础:连接查询 联合查询 代码
SQL SERVER的优化建议与方法
简单的SQL Server备份脚本代码
sql基本函数大全
SQL查询语句精华使用简要
数据库分页存储过程代码
SQL查询连续号码段的巧妙解法
sql server中千万数量级分页存储过程代码
sql2000各个版本区别总结
如何远程连接SQL Server数据库图文教程
一个SQL语句获得某人参与的帖子及在该帖得分总和
通用分页存储过程,源码共享,大家共同完善
SQL查找某一条记录的方法
使用 GUID 值来作为数据库行标识讲解
非常详细的SQL--JOIN之完全用法
收缩后对数据库的使用有影响吗?

MSSQL 中的 在IE中直接连接SQL数据库


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-10-30   浏览: 39 ::
收藏到网摘: n/a

 

使用ODC文档


使用一个ODC文档可以很轻松在IE浏览器中连接到SQL SERVER数据库的表,ODC文档示例如下:

<html>

<head>

<meta http-equiv=Content-Type content="text/x-ms-odc; charset=utf-8">

<meta name=ProgId content=ODC.Table>

<meta name=SourceType content=OLEDB>

<meta name=Catalog content=K0712>

<meta name=Schema content=dbo>

<meta name=Table content="T_Material">

<xml id=docprops></xml><xml id=msodc><odc:OfficeDataConnection

  xmlns:odc="urn:schemas-microsoft-com:office:odc"

  xmlns="http://www.w3.org/TR/REC-html40">

  <odc:Connection odc:Type="OLEDB">

   <odc:ConnectionString>Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=True;Data Source=develop;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=DEVELOP;Use Encryption for Data=False;Tag with column collation when possible=False;Initial Catalog=K0712</odc:ConnectionString>

 

   <odc:CommandType>Table</odc:CommandType>

 

<odc:CommandText>&quot;K0712&quot;.&quot;dbo&quot;.&quot;ICInventory&quot;</odc:CommandText>

 

  </odc:Connection>

 </odc:OfficeDataConnection>

</xml>

<style>

<!--

    .ODCDataSource

    {

    behavior: url(dataconn.htc);

    }

-->

</style>

</head>

<body onload='init()' scroll=no leftmargin=0 topmargin=0 rightmargin=0 style='border: 0px'>

<table style='border: solid 1px threedface; height: 100%; width: 100%' cellpadding=0 cellspacing=0 width='100%'>

  <tr>

    <td id=tdName style='font-family:arial; font-size:medium; padding: 3px; background-color: threedface'>

      &nbsp;

    </td>

     <td id=tdTableDropdown style='padding: 3px; background-color: threedface; vertical-align: top; padding-bottom: 3px'>

      &nbsp;

    </td>

  </tr>

  <tr>

    <td id=tdDesc colspan='2' style='border-bottom: 1px threedshadow solid; font-family: Arial; font-size: 1pt; padding: 2px; background-color: threedface'>

      &nbsp;

    </td>

  </tr>

  <tr>

    <td colspan='2' style='height: 100%; padding-bottom: 4px; border-top: 1px threedhighlight solid;'>

      <div id='pt' style='height: 100%' class='ODCDataSource'></div>

    </td>

  </tr>

</table>

<script language='javascript'>

function init() {

  var sName, sDescription;

  var i, j;

  try {

    sName = unescape(location.href)

    i = sName.lastIndexOf(".")

    if (i>=0) { sName = sName.substring(1, i); }

    i = sName.lastIndexOf("/")

    if (i>=0) { sName = sName.substring(i+1, sName.length); }

    document.title = sName;

    document.getElementById("tdName").innerText = sName;

    sDescription = document.getElementById("docprops").innerHTML;

    i = sDescription.indexOf("escription>")

    if (i>=0) { j = sDescription.indexOf("escription>", i + 11); }

    if (i>=0 && j >= 0) {

      j = sDescription.lastIndexOf("</", j);

评论 (0) All

登陆 还没注册?