当前位置: 首页 > 网络学院 > 服务端脚本教程 > ADO > ADO Status 属性

ADO
ADO介绍
ADO数据库连接
ADO记录集
ADO显示记录
ADO查询语句
ADO记录排序
ADO添加记录
ADO更新记录
ADO删除记录
ADO演示
ADO提升执行速度
ADO Command对象
ADO Connection对象
ADO Error
ADO Field
ADO Parameter
ADO 属性
ADO Record
ADO Recordset
ADO Stream

ADO Status 属性


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-04   浏览: 358 ::
收藏到网摘: n/a

The Status property returns a FieldStatusEnum value that indicates the status of a Field object. Default value is adFieldOK.
Status属性的作用是:返回一个指示字段对象状态的值,该值为FieldStatusEnum之中的其中一个。默认值为adFieldOK。

If any updates fail then an error is returned and the Status property indicates the combined values of the operation and error status code. The Status property for each Field can be used to determine why the Field was not added, modified, or deleted.
如果更新失败,那么它将返回错误提示,此时,Status[状态]属性将给出操作和错误代码。每个字段的Status[状态]属性可以用来解释为什么字段不能被添加、修改或是删除。

Problems with adding, modifying, or deleting a Field are reported through this property. For example, if a user deletes a Field, it will be marked for deletion in the Fields collection. If the Update call returns an error because the user tried to delete a Field for which he does not have permission, the Status for this field will be adFieldPermissionDenied or adFieldPendingDelete.
在对一个字段进行添加、修改或删除的过程中,所有问题都是通过Status[状态]属性出具错误报告的。举个例子来说,如果用户删除一个字段,它将对字段集中需要删除的字段作出标记。如果用户对字段不具有删除权限而进行删除操作,导致更新请求出错,那么该字段的状态便是adFieldPermissionDenied或adFieldPendingDelete。

Syntax
语法

objfield.Status

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).Status)
rs.Close
conn.close
%>


FieldStatusEnum Values

Constant
常量
Value
Description
描述
adFieldOK 0 Default. The field was successfully added or deleted
默认值。字段被成功添加或删除
adFieldCantConvertValue 2 The field cannot be retrieved or stored without loss of data
指示字段可以在不丢失任何数据的情况下被提取和储存
adFieldIsNull 3 The provider returned a null value
指示技术提供对象[provider]返回一个空值
adFieldTruncated 4 Variable-length data was truncated when reading from the data source
指示从数据源读取数据时缩略的可变长值数据
adFieldSignMismatch 5 The data value returned by the provider was signed, but the data type of the ADO field value was unsigned
指示通过技术提供对象[provider]返回的数值带有正负号;但是ADO字段值的数值类型不带有正负号
adFieldDataOverflow 6 The data returned from the provider overflowed the data type of the field
指示从技术提供对象[provider]返回的数值溢出字段的数值类型
adFieldCantCreate 7 The field could not be added because the provider exceeded a limitation
由于技术提供对象[provider]超出限制要求,所以不能再添加字段
adFieldUnavailable 8 The provider could not determine the value when reading from the data source
当从数据源读取数据时,技术提供对象[provider]不能决定其值
adFieldPermissionDenied 9 The field cannot be modified because it is read-only
指示字段不能被更改,因为其属性为只读
adFieldIntegrityViolation 10 The field cannot be modified because it is a calculated or derived entity
指示字段不能被更改,因为它食一个已被计算过或已被导出的实体
adFieldSchemaViolation 11 The value violated the data source schema constraint for the field
指示值违反了数据源计划[data source schema]对字段的限制
adFieldBadStatus 12 An invalid status value was sent from ADO to the OLE DB provider
指示一个从ADO发送到OLEDB提供者的有效状态值
adFieldDefault 13 The default value for the field was used when setting data
设置默认使用的字段值
adFieldIgnore 15 This field was skipped when setting data values in the source
设置数据源中的数据值时,指定跳过的字段
adFieldDoesNotExist 16 The field does not exist
指示字段不存在
adFieldInvalidURL 17 The data source URL contains invalid characters
指示包含无效字符的数据源的URL
adFieldResourceLocked 18 The provider cannot perform the operation because the data source is locked
由于数据源被锁,所以技术提供对象[provider]不能执行操作
adFieldResourceExists 19

The provider cannot perform the operation because an object already exists at the destination URL and it is not able to overwrite the object
指示由于对象已经在目标URL中存在并且它不能被覆盖,所以技术提供对象[provider]无法执行操作

adFieldCannotComplete 20 The server of the URL specified by Source could not complete the operation
指示通过数据源指定的URL服务器不能完成操作
adFieldVolumeNotFound 21 The provider is unable to locate the storage volume indicated by the URL
指示技术提供对象[provider]不能定位URL指示的存量信息
adFieldOutOfSpace 22 The provider is unable to obtain enough storage space to complete a move or copy operation
指示技术提供对象[provider]不能获取足够存储的空间来完成“移动”或“复制”操作
adFieldCannotDeleteSource 23 During a move operation, a tree or subtree was moved to a new location, but the source could not be deleted
指示在执行“移动”操作时,一个树形列表或子树形列表被移动到一个新的地点,但是数据源不会被删除
adFieldReadOnly 24 The field in the data source is read-only
指示字段在数据源中的属性为只读
adFieldResourceOutOfScope 25 A source or destination URL is outside the scope of the current record
指示一个数据源或目标URL超出当前记录的范围
adFieldAlreadyExists 26 The specified field already exists
指定的字段已经存在
adFieldPendingInsert 0x10000 The Append operation caused the status to be set. The field has been marked to be added to the Fields collection after the Update method is called
指示在状态中设置添加操作。通过请求更新方法后,被添加到字段集中的字段已经被做上标记
adFieldPendingDelete 0x20000 The Delete operation caused the status to be set. The field has been marked for deletion from the Fields collection after the Update method is called
指示在状态中设置删除操作。通过请求更新方法后,被删除的字段集中的字段已经被做上标记
adFieldPendingChange 0x40000 The field has been deleted and then re-added or the value of the field which previously had a status of adFieldOK has changed
指示字段已经被删除并被重新添加,或者字段先前具有的adFieldOK状态树形已经被更改
adFieldPendingUnknown 0x80000 The provider cannot determine what operation caused field status to be set
指示技术提供对象[provider]不能够决定在字段的状态属性中执行什么样的操作
adFieldPendingUnknownDelete 0x100000 The provider cannot determine what operation caused field status to be set, and that the field will be deleted from the Fields collection after the Update method is called.
指示技术提供对象[provider]不能够决定在字段的状态属性中执行什么样的操作,以及在请求Update[更新]方法后,字段将从字段集中删除

评论 (0) All

登陆 | 还没注册?