网络学院 w3pop社区 网络资源 IT新闻

w3pop.com :: 网络学院 :: ADO :: ADO DefinedSize 与 ActualSize

会员登陆

帐号

密码

回答

记住密码

忘记密码? 注册

ADO DefinedSize 与 ActualSize


作者:w3pop.com 翻译/整理:w3pop.com 发布:2007-04-28 浏览:1253 :: ::

The DefinedSize property returns a long value that indicates the defined size of a field (in bytes).
DefinedSize属性的作用是:返回一个用于定义字段长度的值。

The ActualSize property is a read-only property. It returns a long value that indicates the actual length of a field's value. If ADO cannot determine the length of the Field object's value, it returns adUnknown.
ActualSize属性是只读的。它的作用是返回一个字段值的真实长度。如果ADO不能定义一个字段值的真实长度,那么它将返回adUnknown。

The DefinedSize property defines how long a field's value can be, while ActualSize tells how long it really is.
DefinedSize属性是定义一个字段值所允许的长度的;而ActualSize是指明字段的真实长度的。

Syntax
语法

objrs.Fields(number).DefinedSize

objrs.Fields(number).ActualSize

Example
案例

<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "c:/webdata/northwind.mdb"
set rs=Server.CreateObject("ADODB.Recordset")
rs.open "Select * from orders", conn
response.write(rs.Fields(0).DefinedSize)
response.write(rs.Fields(0).ActualSize)
rs.Close
conn.close
%>

评论 (0) All