Re: Query to get Table schema



On 12 Mar 2006 07:54:47 -0800, "Lyle Fairfield"
<lylefairfield@xxxxxxx> wrote:

Great; to allow for the very small chance that someone else is looking
at this I note that I have changed the page address to:
http://ffdba.com/columns.asp
Page looks great... I'll share my code too:

<%@Language=VBScript %>
<!-- #include file="adovbs.inc"-->
<%
Set objDB = Server.CreateObject ("ADODB.connection")
sDBName = "driver={Microsoft Access Driver (*.mdb)};dbq=" &
Request.ServerVariables("APPL_PHYSICAL_PATH") & "Y O U R M D B"

objDB.Open sDBName

'Set objRS = objDB.Execute(SQLQuery)
set objRS = objDB.openschema(adschemacolumns, array(empty,
empty, "Y O U R T A B L E N A M E "))
If not objRS.EOF Then
Response.Write "Number of columns in table = " &
objRS.fields.count & "<BR>"
Response.Write "<table border=1 align=center><tr>"
for count = 0 to objRS.fields.count-1
Response.Write "<th>" &
objRS.fields(count).name & "</th>"
next
Response.Write "</tr>"
objRS.moveFirst
Do While Not objRS.EOF
for count = 0 to objRS.fields.count-1
Response.Write "<td>" &
objRS(objRS.fields(count).name) & "</td>"
next
Response.Write "</tr>"
objRS.Movenext
Loop
Response.Write "</table>"
End If
objRS.Close
objDB.Close
Set objRS = Nothing
Set objDB = Nothing
%>
.



Relevant Pages

  • Re: Missing semicolon error???
    ... This error message occurs because a WHERE clause is meaningless ... Dim objDB As DAO.Database ... Set objDB = CurrentDb ... Set objRS = objDB.OpenRecordset'IT ERRORS HERE ...
    (microsoft.public.access.queries)
  • Re: Missing semicolon error???
    ... (I populate the variables and have other code too, ... Dim objDB As DAO.Database ... Set objDB = CurrentDb ... Set objRS = objDB.OpenRecordset'IT ERRORS HERE ...
    (microsoft.public.access.queries)
  • Missing semicolon error???
    ... (I populate the variables and have other code too, ... Dim objDB As DAO.Database ... Set objDB = CurrentDb ... Set objRS = objDB.OpenRecordset'IT ERRORS HERE ...
    (microsoft.public.access.queries)
  • Re: Missing semicolon error???
    ... Unless this is actually a pass-thru query to SQL ... Set objDB = CurrentDb ... Set objRS = objDB.OpenRecordset'IT ERRORS HERE ...
    (microsoft.public.access.queries)
  • OpenSchema
    ... Set objRs = objConn.OpenSchema(adSchemaColumns, Array(Empty, Empty, ... strTableName, Empty)) ... Prev by Date: ...
    (microsoft.public.data.ado)