asp能不能去得字段的名称?

数据表:table1
字段1: id
字段2: title
字段3: body

......
set rs=conn.execute("select id,title,body from [table1]")
.....
for i=0 to rs.fields.count
response.write(××××)'这里能不能写出对应的字段名?
response.write(rs(i))
next
......
---------------------------------------------------------------

rs.fields(0).Name
rs.fields(1).Name
---------------------------------------------------------------

Recordset 对象含有由 Field 对象组成的 Fields 集合。每个 Field 对象对应于 Recordset 中的一列。使用 Field 对象的 Value 属性可设置或返回当前记录的数据。取决于提供者具有的不同功能,Field 对象的某些集合、方法或属性有可能无效。

使用 Field 对象的集合、方法、和属性可进行如下操作:
使用 Name 属性可返回字段名。
使用 Value 属性可查看或更改字段中的数据。
使用 Type、Precision 和 NumericScale 属性可返回字段的基本特性。
使用 DefinedSize 属性可返回已声明的字段大小。
使用 ActualSize 属性可返回给定字段中数据的实际大小。
使用 Attributes 属性和 Properties 集合可决定对于给定字段哪些类型的功能受到支持。
使用 AppendChunk 和 GetChunk 方法可处理包含长二进制或长字符数据的字段值。
如果提供者支持批更新,可使用 OriginalValue 和 UnderlyingValue 属性在批更新期间解决字段值之间的差异。
---------------------------------------------------------------

for i=0 to rs.fields.count
response.write(rs.fields(i).Name)'这里能不能写出对应的字段名?
response.write(rs(i))
next
---------------------------------------------------------------

for i=0 to rs.fields.count-1
response.write rs.field(i).name'这里能不能写出对应的字段名?
response.write(rs(i))
next

Published At
Categories with Web编程
Tagged with
comments powered by Disqus