server| Browser Reprint from the foreigner.
Very cool, just modify a few parameters on it, very helpful
<%@ LANGUAGE = JScript%>
<%
var connstr= "Dsn=admin"; //
var userlogin= "SA"; Input empty Login and Password,
var userpassword= ""; If your DSN works via WinNT Trust connection
var charset= "gb2312"; As sample "windows-1251"
var pgsize= 10;
%>
<meta http-equiv= "Content-type" content= "text/html; Charset=<%=charset%> ">
<title>ms SQL Structure Viewer Version 1.2</title>
<body bgcolor= #2f2f2f link= #000000 vlink= #000000 alink= #000000 topmargin=1 leftmargin=1>
<table width= ' 100% ' Bgcolor=gray cellpadding=0 cellspacing=0><td>
<table width= ' 100% ' cellpadding=0 cellspacing=1>
<TR><TD align=center>
<font color=white size=+1><b>ms SQL webtools >> Table Structure viewer</b></font></td >
<TD align=right>
<font Color=black><small><b>written by
<a href= "mailto:little@ivc.tagmet.ru" >
<font Color=black><small><b>alexander tkalich</b></small></a></b></ Small></font>
</td></tr>
</table>
</td>
</table>
<p>
<%
var trcolor1= "#7f9faf", trcolor2= "#bfcfd7";
var trcolor= trColor1;
function IsDef (Value) {
if (value== (value+ "")) return true;
return false;
}
function Qoutselect (Conn, Name, Value, FirstName, Firstvalue, SQL, ssize) {
var rs= conn.execute (SQL);
Response.Write ("<select name= '" + name+ "' size=" + ssize+ ">");
if (firstname!= "")
Response.Write ("<option value= '" + firstvalue+ "' >" + FirstName);
for (;! rs.eof; Rs.movenext ()) {
Id= Rs (0);
nm= Rs (1);
if (value== "" + Id) s= ' selected '; else s= ';
Response.Write ("<option value=" "+ id+" "" + s+ ">" + nm+ "\ n");
}
Response.Write ("</select>");
}
var S, dbname, Tbname, TBL, Row;
if (!isdef (dbname= request.form ("dbname"))
Dbname= request.querystring ("dbname");
if (!isdef (tbid= request.form ("Tbid"))
Tbid= request.querystring ("Tbid");
Tbl= request.querystring ("TBL");
row= request.querystring ("Row")/1;
%>
<center>
<%
var conn= server.createobject ("ADODB"). Connection ");
Conn.Open (ConnStr, Userlogin, UserPassword);
if (!isdef (TBL)) {
%>
<form name= ' F ' method=post action= ' tbstru.asp ' >
<input type=hidden name=currentdb value= ' <%=DbName%> ' >
<table border=1 bgcolor= #7f9faf cellpadding=0 cellspacing=0><td>
<table border=0 cellpadding=8 cellspacing=0><tr valign=bottom><td align=center><b>Databases </b><br>
<%
Qoutselect (Conn, "dbname ' ></td></tr>\n" +
"</table></td></tr></table></td></table></form><p>\n"
);
}
if (!isdef (currentdb= request.form ("CurrentDb"))
currentdb= request.querystring ("CurrentDb");
if (!isdef (TBL) && isDef (dbname) && dbname+ "" = = currentdb+ "" && IsDef (tbid)) "{
Rs= Conn.execute (
"Select O.name, u.name" +
"From" + dbname+ ". Dbo.sysobjects O," +
Dbname+ ". Dbo.sysuser