ADO Type ÊôÐÔ

¶¨ÒåºÍÓ÷¨

Type ÊôÐÔ¿ÉÉèÖûò·µ»ØÒ»¸ö DataTypeEnum Öµ£¬¸ÃÖµ¿Éָʾ Parameter, Field »ò Property ¶ÔÏóµÄÀàÐÍ¡£

¶ÔÏó Type ¶ÔÏóµÄÃèÊö
Parameter ¶ÔÓÚ Parameter ¶ÔÏó£¬Type ÊôÐÔÓµÓжÁ/дȨÏÞ¡£
Field ¶ÔÓÚÒÑ×·¼Óµ½ Record µÄ Fields ¼¯ºÏÖеÄРField ¶ÔÏó£¬Ö»Óе± Field µÄ Value ÊôÐÔÒѱ»Ö¸¶¨²¢ÇÒÊý¾ÝÌṩÕßͨ¹ýµ÷Óà Fields ¼¯ºÏµÄ Update ·½·¨³É¹¦Ìí¼ÓÁËÐ嵀 Field ʱ£¬Type ²ÅΪ¶Á/д¡£
Property ¶ÔÓÚ Property ¶ÔÏó£¬Type ÊôÐÔÊÇÖ»¶ÁµÄ¡£

Óï·¨

objectname.Type

ʵÀý

Õë¶Ô Field ¶ÔÏó£º

<%
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).Type)

rs.Close
conn.close
%>

Õë¶Ô Parameter ¶ÔÏó£º

<%
set comm=Server.CreateObject("ADODB.Command")
set para=Server.CreateObject("ADODB.Parameter")

para.Type=adVarChar
para.Size=25
para.Direction=adParamInput
para.Value=varfname

comm.Parameters.Append para
%>

Õë¶Ô Property ¶ÔÏó£º

<%
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

set prop=Server.CreateObject("ADODB.Property")

'Display the property attributes of the Orders Table
for each prop in rs.Properties
  response.write("Attr:" & prop.Attributes & "<br />")
  response.write("Name:" & prop.Name & "<br />")
  response.write("Value:" & prop.Value & "<br />")
  response.write("Type:" & prop.Type & "<br />")
next

rs.close
conn.close
set rs=nothing
set conn=nothing
%>
VUE