Groups | Blog | Home
all groups > inetserver asp components > november 2003 >

inetserver asp components : How to get the lenght of an Access database using ADOX


Carlos Guzman
11/19/2003 2:46:19 PM
I want to administer a remote Access database using ASP. I use the ADOX
setup. I am able to list the tables, the fields in each table, the field
type. However I can't find a way to find out the field max length or/and
actual length.

Any ideas?

Ray at <%=sLocation%
11/19/2003 2:55:16 PM
From the definedSize property of the column. Example:

<%
Dim oADO, oADOX
Set oADO = Server.CreateObject("ADODB.Connection")
oADO.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=D:\somepath\somefile.mdb;"
Set oADOX = Server.CreateObject("ADOX.Catalog")
oADOX.ActiveConnection = oADO

For Each Table in oADOX.Tables
Response.Write Table.Name & "<br>"
For Each Column in Table.Columns
Response.Write " ---" & Column.Name & ": &nbsp;" &
COLUMN.DEFINEDSIZE & "<br>"
Next
Response.Write "<hr>"
Next

Set oADOX = Nothing
oADO.Close : Set oADOX = Nothing
%>

Ray at work

[quoted text, click to view]

AddThis Social Bookmark Button