打印本文 打印本文 关闭窗口 关闭窗口
在IE中直接连接SQL数据库
作者:武汉SEO闵涛  文章来源:敏韬网  点击数3720  更新时间:2007/11/14 13:08:37  文章录入:mintao  责任编辑:mintao

 

使用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%''''>

[1] [2] [3] [4]  下一页

打印本文 打印本文 关闭窗口 关闭窗口