<% 'save as 1showtablenames.asp %>
<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Getting Table Names</title>
<link rel="stylesheet" type="text/css" href="../index.css">
</head><body>
<p>
<b><font face="Webdings" color="#FF0000">3</font></b><i><font size="1"><a href="http://www.classicaspreference.com/aspexamples/menu.htm">Back
to ASP Examples
Menu</a></font><br>
</i>
<b><font face="Webdings" color="#FF0000">3</font><font size="1"><i><a target="_blank" href="select_database.asp">Back
to Database Selection</a></i></font></b><br>
<b><font face="Webdings" color="#FF0000">3</font></b><i><font size="1"><a href="http://www.classicaspreference.com/aspexamples/menu.htm">Back to Database Interface Wizard Home Page</a></font><br>
</i>
<b><font face="Webdings" color="#FF0000">4</font><i><font size="1"><a title="Please let me know if this has been helpful." href="mailto:lilpeck@gmail.com?subject=database interface generation wizard">This
script cobbled together by Lil Peck</a></font></i></b></p>
<p>From
<a target="_blank" href="http://www.4guysfromrolla.com/webtech/013101-1.2.shtml">
&quot;Working With Adox Part 2&quot;</a> at 4 Guys From Rolla</p>
<%
dim strDB
strDB = request.querystring("mdb")

%>
<p><b><font size="3">Getting table names for database <u><%=strDB %></u>.</font><br>
</b> &nbsp;<br>
<b>Checkmark the table you want, with its fields that you want to use. </b><br>
It is best to check only <font color="#FF0000">ONE table</font>
<font color="#FF0000">and the fields that belong to it,</font> to avoid
errors in the generated script.</p>

<form method="POST" action="2ashowtablenames.asp">

<input type="hidden" name="dbname" value="<%=strDB %>">
<%
Dim objADOXDatabase
Set objADOXDatabase = Server.CreateObject("ADOX.Catalog")

objADOXDatabase.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(strDB) & ";"

Dim objTable, objColumn
For Each objTable in objADOXDatabase.Tables
If objTable.Type = "TABLE" then
Response.Write "<b><input type=""checkbox"" name="&""&"Table"&" value="& objTable.Name &">" & objTable.Name & "</b><br>"



Response.Write "<p>"
End If
Next

Set objADOXDatabase = Nothing
%>

<input type="submit" value="Submit"><input type="reset" value="Reset" name="B2"></p>
</form>




</body>

</html>