仓酷云

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 3553|回复: 18
打印 上一主题 下一主题

[学习教程] ASP教程之源码保举――SQL SERVER布局阅读器

[复制链接]
海妖 该用户已被删除
跳转到指定楼层
楼主
发表于 2015-2-16 00:25:53 | 显示全部楼层 回帖奖励 |倒序浏览 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
优点:简单易学、开发速度快、有很多年“历史”,能找到非常多别人做好的程序来用、配合activeX功能强大,很多php做不到的asp+activeX能做到,例如银行安全控件server|阅读器   从老外那儿转帖过去的

很酷,只需修正几个参数就能够了,很有匡助

<%@ 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 >> 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</p>  asp是基于web的一种编程技术,可以说是cgi的一种。它可以完成以往cgi程序的所有功能,如计数器、留言簿、公告板、聊天室等等。
海妖 该用户已被删除
沙发
 楼主| 发表于 2015-6-26 16:25:57 | 显示全部楼层
学习ASP其实应该上升到如何学习程序设计这种境界,其实学习程序设计又是接受一种编程思想。比如ASP如何学习,你也许在以前的学习中碰到过。以下我仔细给你说几点:
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|仓酷云 鄂ICP备14007578号-2

GMT+8, 2024-5-3 02:09

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表