欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

SQL SERVER结构浏览器

程序员文章站 2023-02-18 14:39:34
从老外那儿转帖过来的很酷,只要修改几个参数就可以了,很有帮助<%@ language = jscript %><%    ...
从老外那儿转帖过来的

很酷,只要修改几个参数就可以了,很有帮助

<%@ 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;    
%>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=<%=charset%>">
<title>ms sql structure viewer version 1.2</title>
</head>
<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 &gt;&gt; table structure viewer</b></font></td>
    <td align=right>
    <font color=black><small><b>written by
    <a href="mailto:little@i.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+ " ");
    }
    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");