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

MSSQL
SQl 跨服务器查询语句
sql2005 HashBytes 加密函数
防止SQLSERVER的事件探查器跟踪软件
Excel导入Sqlserver数据库脚本
sql cast,convert,QUOTENAME,exec 函数学习记录
select into 和 insert into select 两种表复制语句
sqlserver 日志恢复方法(搞定drop和truncate)
海量数据库查询语句
DBCC CHECKIDENT 重置数据库标识列从某一数值开始
MSSQL 数据库同步教程
sql 语句中的 NULL值
判断一个表的数据不在另一个表中最优秀方法
SQL货币数字转英文字符语句
executesql 存储过程
sql 查询结果合并union all用法_数据库技巧
SQLServe 重复行删除方法
SQLServer 数据修复命令DBCC一览
SQLSERVERS 数据整理方法
根据多条件查询临时表 想得到不同结果集的方法
sqlServer 获取汉字字串的拼音声母

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


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-10-30   浏览: 35 ::
收藏到网摘: 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

登陆 还没注册?