Source recommended--sql Server structure browser

Source: Internet
Author: User
Tags dsn
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>
&LT;TR&GT;&LT;TD align=center>
<font color=white size=+1><b>ms SQL webtools >> Table Structure viewer</b></font></td >
&LT;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



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.