Program | data | Database <%
DSN = "Dsn=dsnname"
Const adSchemaTables = 20
adSchemaColumns = 4
Set oconn = Server.CreateObject ("ADODB. Connection ")
oConn.Open DSN
Set Rstschema = Oconn.openschema (adSchemaColumns)
Response.Write "<table>"
Response.Write "<tr><td>table Name</td><td>field Name</td><td>field type</ Td><td>is Nullable</td><td>field size</td></tr> "
Tablename= ""
Do Until rstschema.eof
Response.Write "<tr><td>"
If Rstschema ("table_name") <> TableName Then
Response.Write Rstschema ("table_name")
TableName = Rstschema ("table_name")
Else
Response.Write ""
End If
Response.Write "</td><td>" & Rstschema ("column_name") & "</td><td>"
Select Case Rstschema ("Data_type")
Case "130"
If Rstschema ("character_maximum_length") = 1073741823 Then
Response.Write "Memo"
Else
Response.Write "Text"
End If
Case 135
Response.Write "Date/time"
Case 3
Response.Write "Long Integer"
Case 11
Response.Write "Yes/no"
Case 131
Response.Write "Currency"
Case Else
Response.Write Rstschema ("Data_type")
End Select
Response.Write "</td><td>" & Rstschema ("Is_nullable") & "</td><td>"
If Rstschema ("Character_maximum_length") <> 1073741823 Then
Response.Write Rstschema ("Character_maximum_length")
Else
Response.Write ""
End If
Response.Write "</td></tr>"
Rstschema.movenext
Loop
Response.Write "</table>"
%>