使用ODC文档
使用一个ODC文档可以很轻松在IE浏览器中连接到SQL SERVER数据库的表,ODC文档示例如下:
xmlns:odc="urn:schemas-microsoft-com:office:odc"
xmlns="http://www.w3.org/TR/REC-html40">
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
Table
"K0712"."dbo"."ICInventory"
这样,可以很方便的在Web页面上显示数据表了J
会Web编程的都知道其实是一个HTML文本,采用Javascript来初始化窗口布局,加粗的部分是数据连接的关键部分,如下所示:
Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=True;Data Source=develop;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Works