会员登录
用户名:
密  码:
 海岸线公告
    为更好的服务广大用户,厦门海岸线网站在版面和功能上进行升级,欢迎各位朋友给我们提出你宝贵的意见!(可以将你的意见发送到chifengming@163.com或者加QQ:53938519)  
 国内推广
    没有资金的投入,很难做推广而且在国内,这些类型的品牌很多,那要看生产商能不能...  
网络实名
中国搜索联盟
百度竞价排名
新浪网站推广
搜狐网站推广
网易网站推广
 国外推广
    企业既然上网,就要充分利用互联网的特点与优势,采用互联网全新的宣传营销模式,不囿开传统媒介宣传...  
Google
Lycos
Yahoo国外推广
日本推广
 软件推广
    本站开发销售各类推广软件信息发布软件,网站推广软件,网站推广软件网络推广软件推广...  
短信群发软件
信息发布软件
网站推广软件
仓库管理软件
海岸信息



标题:一种比使用include adovbs.inc更好的方法
Using METADATA to Import DLL Constants
One disadvantage of ASP is that when using a component, the component's constants aren't immediately avaialable. For example, if you want to use the ADO constant adOpenStatic you need to include adovbs.inc. While there is nothing wrong with this, wouldn't it be nice not to have to always be sure to include adovbs.inc each time that you wanted to use an ADO constant?

Your days of including adovbs.inc are over! The METADATA tag can be used to automatically import the constants from a DLL or TBL file. For example, imagine that we wanted to crate a recordset object with a Keyset cursor. We'd have to use code similar to:


<%
Dim objConn, strSQL
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open "DSN=Blah"

strSQL = "SELECT * FROM Table1"

Dim objRS
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open strSQL, objConn, adOpenKeyset

'...
%>



We can use the METADATA tag in place of the . The METADATA tag has the following form:





First off, you need to set TYPE="typelib". Concerning the other two parameters, FILE and UUID, you need to only specify one. You can either specify the TBL or DLL file directly with the FILE property, or through the UUID. For example, on my machine, the following two statements would be identical:





and





You can then place this METADATA tag in place of the #include. For example, the first script we examined would be changed to:



<%
Dim objConn, strSQL
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open "DSN=Blah"

strSQL = "SELECT * FROM Table1"

Dim objRS
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open strSQL, objConn, adOpenKeyset

'...
%>



Now, why would anyone want to use this longer METADATA tag on each page as opposed to the standard #include file="adovbs.inc"? Well, no one probably would want to do that. However, you can place the METADATA tag in your Global.asa file, which will give every ASP page in your web application knowledge of the ADO constants! Pretty sweet, eh? The METADATA tag should come before the
 
 
 
 
客户中心
会员管理 诚征代理
客户投诉 付款方式
技术支持 人才招聘
常见问题    
友情链接
==厦门海岸线网络==
==厦门软件开发==
==海岸线OA办公软件==
==厦门OA办公软件==
==海岸线进销存软件==
==厦门进销存软件==
==厦门iphone软件==
==龙岩软件开发==
==海岸线三维动画==
==厦门三维动画==
==中国古董网==
==中国树苗网==
==厦门化妆品网==
==中国冬笋批发网==
==棒球网==
首  页 | 关于我们 | 人才招聘 | 付款方式 | 联系我们 | 客户中心 | 网站地图
地址:厦门市软件园二期 E-mail:chifengming@163.com 邮编:361000
厦门海岸线网络科技有限公司 版权所有 CopyRight WWW.COAST-LINE.CN,All Right Reserved.
电话:0592-8962864 5839031 5839032 5839033 5839034 传真:0592-3237389 手机:13616028684 QQ1:53938519 QQ2:418143918