<%@ Language = VBSCRIPT %> <% Option Explicit %> <!--#include virtual="/adovbs.inc"--> <% 'Column variables Dim iLength, iPrecision, iScale, iDefaultValue Dim objConn, objTableRS, objColumnRS Set objConn = Server.CreateObject("ADODB.Connection") objConn.ConnectionString = "DSN=4Guys" objConn.Open Set objTableRS = objConn.OpenSchema(adSchemaTables, _ Array(Empty, Empty, Empty, "TABLE")) Do While Not objTableRS.EOF Response.Write "<TABLE BORDER=1 CELLSPACING=1><TR>" Response.Write "<TH COLSPAN=7 BGCOLOR=#CCCCCC>" Response.Write "<FONT SIZE=+2>" Response.Write objTableRS("Table_Name").Value Response.Write "</FONT></TH></TR>" Response.Write "<TR><TD BGCOLOR=#CCCCCC>Name</TD>" Response.Write "<TD BGCOLOR=#CCCCCC>Datatype</TD>" Response.Write "<TD BGCOLOR=#CCCCCC>Length</TD>" Response.Write "<TD BGCOLOR=#CCCCCC>Precision</TD>" Response.Write "<TD BGCOLOR=#CCCCCC>Scale</TD>" Response.Write "<TD BGCOLOR=#CCCCCC>Allow Nulls</TD>" Response.Write "<TD BGCOLOR=#CCCCCC>Default Value</TD>" Response.Write "</TR>" Set objColumnRS = objConn.OpenSchema(adSchemaColumns, _ Array(Empty, Empty, objTableRS("Table_Name").Value)) Do While Not objColumnRS.EOF iLength = objColumnRS("Character_Maximum_Length") iPrecision = objColumnRS("Numeric_Precision") iScale = objColumnRS("Numeric_Scale") iDefaultValue = objColumnRS("Column_Default") If IsNull(iLength) then iLength = "&nbsp;" If IsNull(iPrecision) then iPrecision = "&nbsp;" If IsNull(iScale) then iScale = "&nbsp;" If IsNull(iDefaultValue) then iDefaultValue = "&nbsp;" Response.Write "<TR><TD>" & objColumnRS("Column_Name") & "</TD>" Response.Write "<TD>" & objColumnRS("Data_Type") & "</TD>" Response.Write "<TD>" & iLength & "</TD>" Response.Write "<TD>" & iPrecision & "</TD>" Response.Write "<TD>" & iScale & "</TD>" Response.Write "<TD ALIGN=CENTER><FORM><INPUT TYPE=CHECKBOX" If objColumnRS("Is_Nullable") then Response.Write " CHECKED" End If Response.Write "></FORM></TD>" Response.Write "<TD>" & iDefaultValue & "</TD>" Response.Write "</TR>" objColumnRS.MoveNext Loop objTableRS.MoveNext Set objColumnRS = Nothing Response.Write "</TABLE><P>" Loop objTableRS.Close Set objTableRS = Nothing objConn.Close Set objConn = Nothing %>