How ADO obtains the field information of the table in the database two

Source: Internet
Author: User
Tags date datetime integer
Take a previous example:

The Attributes property of the Connection object: Represents the state of the database connection, added by the following values, with a preset value of 0:
&h00020000: Calling CommitTrans.
&h00020000: Calling RollbackTrans.
State property: Displays the status of the object:
0: The object is already closed.
1: The object is already open.
Let's look at an example of using the Attributes/state attribute in ASP code.

For example, ASP code rs17.asp as follows:

<%

Set conn1 = Server.CreateObject ("ADODB. Connection ")

Conn1. Open "dbq=" & Server.MapPath ("Ntopsamp.mdb") & ";D river={microsoft Access Driver (*.mdb)};D riverid=25;fil=ms Access; "

Response.Write "<br>conn1. Attributes: "& Conn1. Attributes

Response.Write "<br>conn1. State: "& Conn1. Attributes

Set rs2 = Server.CreateObject ("ADODB. Recordset ")

Rs2. Open "Products", conn1,1,1

For each fld in RS2. Fields

Response.Write "<BR>" & fld. Name & "=" & Hex (FLD. Attributes)

Next

%>

The above ASP code rs17.asp, the client uses the browser, browses the execution result, for each fld in RS2. Fields gets the message for all fields. Show:

field type is text text field, DateTime date field, Integer int field, Memo Memo field, writable data (&h00000004), acceptable null data value (&AMP;H00000020), Data value (&h00000040) that may be read to NULL in this field.
The field type is the datetime date field, the integer int field, and the fixed-length data (&h00000010).
The field type is the Memo Memo field, which is a long bit (binary) field (&h00000040).

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.