Nå, har selv fundet løsningen på problemet.
Hvis nogen skulle være interesseret i koden til en ASP-programmeret oversigt over MySQL-databaser, så er den her, med JavaScript, og CSS:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="
http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<%
' Change variables to fit your configuration
strServer = "localhost"
strUid = "root"
strPid = "1234"
%>
<script type="text/javascript" language="javascript">
function show_element(element_id)
{
// Hide the 'Show' link
document.getElementById(element_id + "_show").style.visibility="hidden";
document.getElementById(element_id + "_show").style.display="none";
// Show the 'Hide' link
document.getElementById(element_id + "_hide").style.visibility="visible";
document.getElementById(element_id + "_hide").style.display="block";
// Show the DIV box
document.getElementById(element_id).style.visibility="visible";
document.getElementById(element_id).style.display="block";
}
function hide_element(element_id)
{
// Hide the 'Hide' link
document.getElementById(element_id + "_hide").style.visibility="hidden";
document.getElementById(element_id + "_hide").style.display="none";
// Show the 'Show' link
document.getElementById(element_id + "_show").style.visibility="visible";
document.getElementById(element_id + "_show").style.display="block";
// Hide the DIV box
document.getElementById(element_id).style.visibility="hidden";
document.getElementById(element_id).style.display="none";
}
</script>
<style type="text/css">
body{
font:normal 12px Verdana, Arial, Helvetica, sans-serif;
cursor:default;}
div.div_box_placeholder{
width:900px;}
div.spacing{
height:1px;}
a.show_hide_links{
color:#0066FF;
cursor:default;}
a.show_hide_links:hover{
text-decoration:underline;}
div.show_hide_element_database{
border-left:2px solid #CCCCCC; border-right:2px solid #CCCCCC; border-bottom:2px solid #CCCCCC;
visibility:hidden; display:none;}
div.show_hide_element_table{
visibility:hidden; display:none;}
a.show_links_database{
color:#0066FF;
background-color:#CCCCCC;
cursor:default;
display:block;}
a.show_links_database:hover{
text-decoration:underline;}
a.hide_links_database{
color:#0066FF;
background-color:#CCCCCC;
cursor:default;
visibility:hidden; display:none;}
a.hide_links_database:hover{
text-decoration:underline;}
a.show_links_table{
color:#0066FF;
cursor:default;
display:block;}
a.show_links_table:hover{
text-decoration:underline;}
a.hide_links_table{
color:#0066FF;
cursor:default;
visibility:hidden; display:none;}
a.hide_links_table:hover{
text-decoration:underline;}
td.db_table_info_headline{
border-bottom:1px solid #333333;}
td.db_table_info_item_first{
border-bottom:1px solid #333333; border-left:1px solid #333333; border-right:1px solid #333333;}
td.db_table_info_item{
border-bottom:1px solid #333333; border-right:1px solid #333333;}
</style>
<body>
<%
set conn = Server.CreateObject("ADODB.Connection")
conn.Open " DRIVER=MySQL ODBC 3.51 Driver; SERVER=" &strServer& "; UID=" &strUid& "; PWD=" &strPid& "; "'DATABASE=test;"
%>
<%
' Count all databases, and tables
intDatabases = 0
intTables = 0
' Checks if there are databases with " " or "-"
on error resume next
set dbShowDatabases = conn.execute("show databases")
while not dbShowDatabases.eof
for each item in dbShowDatabases.fields
intDatabases = intDatabases + 1
if instr(dbShowDatabases.fields(item.name), " ") or instr(dbShowDatabases.fields(item.name), "-") then
'response.write "FEJL"
else
set dbShowTables = conn.execute("show tables from " &dbShowDatabases.fields(item.name)& "")
end if
' set dbShowTables = conn.execute("show tables from " &dbShowDatabases.fields(item.name)& "")
while not dbShowTables.eof
intTables = intTables + 1
dbShowTables.movenext
wend
next
dbShowDatabases.movenext
wend
' Checks if there are databases with " " or "-"
if err.number <> 0 then
response.write "<strong>ERROR!</strong>"
response.write "<br />"
response.write "You have databases with either '' '' (space) or ''-'' !"
response.write "<br />"
response.write "Therefore you cannot use this function, yet..."
response.write "<br />"
response.write "I am working on a solution to the problem"
response.end()
err.clear
end if
response.write "<strong>Status for ''" &strServer& "'':</strong>"
response.write "<br />"
response.write intDatabases& " databases, with " &intTables& " tables"
response.write "<br /><br />"
'response.end()
%>
<%
' Link to show all elements
response.write "<a onclick="
x = 1
do while x <= intDatabases
response.write "show_element('div_box" &x& "');"
x = x + 1
loop
response.write " class='show_hide_links'>"
response.write "Show all"
response.write "</a>"
response.write " "
' Link to hide all elements
response.write "<a onclick="
x = 1
do while x <= intDatabases
response.write "hide_element('div_box" &x& "');"
x = x + 1
loop
response.write " class='show_hide_links'>"
response.write "Hide all"
response.write "</a>"
response.write "<br /><br />"
%>
<%
'<-- Show all databases
set dbShowDatabases = conn.execute("show databases")
x = 1
while not dbShowDatabases.eof
for each item in dbShowDatabases.fields
response.write "<div class='div_box_placeholder'>"
response.write "<a onclick=show_element('div_box" &x& "'); id='div_box" &x& "_show' class='show_links_database'>"
response.write dbShowDatabases.fields(item.name)
response.write "</a>"
response.write "<a onclick=hide_element('div_box" &x& "'); id='div_box" &x& "_hide' class='hide_links_database'>"
response.write dbShowDatabases.fields(item.name)
response.write "</a>"
'<-- Show all tables in the database
response.write "<div id='div_box" &x& "' class='show_hide_element_database'>"
set dbShowTables = conn.execute("show tables from " &dbShowDatabases.fields(item.name)& "")
if dbShowTables.bof or dbShowTables.eof then
response.write "---- * no tables *"
response.write "<br />"
end if
y = 1
while not dbShowTables.eof
response.write "<a onclick=show_element('div_box" &x& "." &y& "'); id='div_box" &x& "." &y& "_show' class='show_links_table'>"
response.write "---- " &lcase(dbShowTables("tables_in_" &dbShowDatabases.fields(item.name)))
response.write "</a>"
response.write "<a onclick=hide_element('div_box" &x& "." &y& "'); id='div_box" &x& "." &y& "_hide' class='hide_links_table'>"
response.write "---- " &lcase(dbShowTables("tables_in_" &dbShowDatabases.fields(item.name)))
response.write "</a>"
'<-- Show information for the tables
conn.execute("use " &dbShowDatabases.fields(item.name)& "")
set dbTableInfo = conn.execute("describe " &dbShowTables("tables_in_" &dbShowDatabases.fields(item.name))& "")
response.write "<div id='div_box" &x& "." &y& "' class='show_hide_element_table'>"
response.write "<table border='0' cellspacing='0' cellpadding='0' class='db_table_info'>"
response.write "<tr>"
response.write "<td>"
response.write " "
response.write "</td>"
response.write "<td width='5'> </td>"
response.write "<td width='250' class='db_table_info_headline'>"
response.write "Name:"
response.write "</td>"
response.write "<td width='5' class='db_table_info_headline'> </td>"
response.write "<td width='100' class='db_table_info_headline'>"
response.write "Type:"
response.write "</td>"
response.write "<td width='5' class='db_table_info_headline'> </td>"
response.write "<td width='40' class='db_table_info_headline'>"
response.write "Null:"
response.write "</td>"
response.write "<td width='5' class='db_table_info_headline'> </td>"
response.write "<td width='40' class='db_table_info_headline'>"
response.write "Key"
response.write "</td>"
response.write "<td width='5' class='db_table_info_headline'> </td>"
response.write "<td width='150' class='db_table_info_headline'>"
response.write "Default:"
response.write "</td>"
response.write "<td width='5' class='db_table_info_headline'> </td>"
response.write "<td width='150' class='db_table_info_headline'>"
response.write "Extra:"
response.write "</td>"
response.write "</tr><tr>"
while not dbTableInfo.eof
response.write "<td>"
response.write " "
response.write "</td>"
response.write "<td width='5'> </td>"
response.write "<td class='db_table_info_item_first'>"
response.write dbTableInfo("field")
response.write "</td>"
response.write "<td width='5' class='db_table_info_item'> </td>"
response.write "<td class='db_table_info_item'>"
response.write dbTableInfo("type")
response.write "</td>"
response.write "<td width='5' class='db_table_info_item'> </td>"
response.write "<td class='db_table_info_item'>"
response.write dbTableInfo("null")& " "
response.write "</td>"
response.write "<td width='5' class='db_table_info_item'> </td>"
response.write "<td class='db_table_info_item'>"
response.write dbTableInfo("key")& " "
response.write "</td>"
response.write "<td width='5' class='db_table_info_item'> </td>"
response.write "<td class='db_table_info_item'>"
response.write dbTableInfo("default")& " "
response.write "</td>"
response.write "<td width='5' class='db_table_info_item'> </td>"
response.write "<td class='db_table_info_item'>"
response.write dbTableInfo("extra")& " "
response.write "</td>"
response.write "</tr><tr>"
dbTableInfo.movenext
wend
response.write "</tr>"
response.write "</table>"
response.write "</div>"
'-->
y = y + 1
dbShowTables.movenext
wend
response.write "</div>"
'-->
x = x + 1
response.write "</div>"
next
response.write "<br />"
dbShowDatabases.movenext
wend
'-->
%>
<%
conn.close
set conn = nothing
%>
</body>
</html>
/xicrow