To obtain field information for a table in a database, the properties of the following Recordset object are known to be:
ActualSize property: The actual size of the field.
DefinedSize property: Defines the size of the field.
Type property: Field type, which is represented by the following numbers:
Text text:200
Date Time date:135
Integer int/identification code: 3
Single degree of precision: 4
Double precision: 5
Note memo:201
Whether Yes/no:17
Name property: Field name.
NumericScale property: The number of digits in the field's decimal part.
Precision Property: The maximum number of digits added to the integer and decimal digits of the field.
Example of a field information for a table in a database
Let's look at an example of using Actualsize/definedsize/type/name/numericscale/precision in ASP code.
For example, ASP code rs2.asp as follows:
<%
Set conn1 = Server.CreateObject ("ADODB. Connection ")
Response.Write "Type:" & rs1 ("delete"). Type & "<p>"
%>
The above ASP code rs2.asp the client uses the browser to browse the results of the execution, displaying field information for each field, including the actual size of the field (ActualSize), the defined field size (definedsize), the field type (type), the field name (name), The number of digits (numericscale), integers, and decimal places (Precision), and so on, of the field's decimal parts.
Attributes/state Property
To get more detailed information about the fields of the tables in the database, such as whether the field includes fixed-length data, acceptable null data values, autonumber identifiers, and so on, the properties of the following Recordset object are known:
The Attributes property of the Field object: Represents the state of the fields, added by the following values:
&h00000002: This field is Memo type.
&h00000004: This field can be written to data.
&h00000008: This field is not determined to write data.
&h00000010: This field includes fixed-length data.
&h00000020: This field can accept null data values.
&H00000040: A data value that may be read to NULL in this field.
&h00000080: This field is a long binary, and you can use the AppendChunk and GetChunk methods.
&H00000100: This field includes an AutoNumber identification code.
&H00000200: This field includes the date time.
&h00001000: This field uses cache.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.