Copy Code code as follows:
<%
' Function: Display the table name, field name, field contents in the database
' Original: Wangsdong
' original article, reprint please keep this information, thank you
Set Rs=server. CreateObject ("Adodb.recordset")
db= "Db1.mdb"
Set Conn=server. CreateObject ("Adodb.connection")
Connstr= "Provider=Microsoft.Jet.OLEDB.4.0;Data source=" & Server.MapPath (DB)
Conn.Open ConnStr
Set Rs=conn.openschema (20)
Do Until Rs. Eof
If RS (3) = "TABLE" Then
Response.Write "Table name:" &rs (2) & "<br/>"
Set Rs1=server. CreateObject ("Adodb.recordset")
Sql= "SELECT * from" &rs (2)
Set rs1=conn.execute (SQL)
Response.Write "Field Name:"
For I=0 to Rs1.fields.count-1
Response.Write Rs1.fields (i) .name& ""
Next
Response.Write "<br/>"
Do as not rs1.eof
Response.Write ""
For I=0 to Rs1.fields.count-1
T=rs1.fields (i). Name
Response.Write Rs1 (t) & ""
Next
Response.Write ""
Rs1.movenext
Loop
Response.Write ""
End If
Rs. MoveNext
Loop
Set rs=nothing
Set conn=nothing
% >
Just change the database name and run the program, and you'll see the results.