⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.asp

📁 SQL学习宝典2.0的使用说明: 1.在win95,win98下要安装PWS(win98安装盘里有). 2.把sql2目录设为虚拟目录。 2.在浏览器中运行http://localhost/sq
💻 ASP
字号:
<%Response.Expires=0%>
<!-- #include file="conn.inc" -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>SQL学习宝2.0</title>
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<link rel="stylesheet" type="text/css" href="style.css" title="style">
<base target="main">
</head>
<body marginheight="5" marginwidth="0" topmargin="0" leftmargin="0" rightmargin="0" >
<%
'取得ASP本身的 URL以处理 HTML表单
self = Request.ServerVariables("PATH_INFO")
%> 
   <FORM NAME="display" ACTION="<% = self %>" 
    METHOD="post">
  数据库中的所有表: <%                                           
                                           
' 显示数据库内所有表                                           
tbl = Request("tbl")                                           
SchemaToList conn, tbl        
            
sqlcx=CheckChar(request("sqlcx"))                                           
                                           
%> <INPUT TYPE="submit" VALUE="显示">                                       
  请先选择资料表,再按[显示]钮查询 <a href="#" onclick="window.open('souc.asp','news','top=50,width=600,height=300,scrollbars=yes')">查看收藏</a> </form>                                    
<%       
sqlcx=trim(request("sqlcx"))       
sqlxg=trim(request("sqlxg"))       
                                  
if tbl<>"" or sqlcx<>"" then             
             
if tbl<>"" then             
sql="select * from "&tbl             
end if                                
                                  
if sqlcx<>"" then                                   
sql=sqlcx       
sqlcx=CheckChar(sqlcx)                                 
if request("c1")="ON" then                                   
conn.execute("insert into sql(sql) values('"&sqlcx&"')")                                   
end if                                   
end if       
                                  
set rs=conn.execute(sql)                                 
ShowRS1(rs)             
             
end if       
       
if sqlxg<>"" then      
conn.execute(sqlxg)    
response.write"<hr>SQL语句:"&sqlxg    
response.write"<br><font color=#FF0000>SQL语句执行成功!</font><hr>"      
end if %>              
      <form method="POST" ACTION="<% = self %>">检索数据SQL语句:                                                         
   <table border="1" width="100%" bgcolor="#C0C0C0" bordercolorlight="#808080" cellspacing="0" cellpadding="0" bordercolordark="#FFFFFF">                                                                     
          <tr>                                                                     
            <td width="100%">                                                                     
              <table border="0" width="100%" cellspacing="0" cellpadding="0">                                                                     
                <tr>                                                                     
                  <td width="100%">                                                                
 <input type="text" name="sqlcx" size="80" value="<%if sql<>"" then                                        
response.write sql                                       
else                                       
response.write "select * from asset"                                       
end if%>">                                                               
                  <input type="submit" value="提交" name="B1" class="buttons02"><input type="checkbox" name="C1" value="ON">收藏                                                                      
                  </td>                                                                    
                                                                                     
                </tr>                                                                       
              </table>                                                                       
            </td>                                                                       
          </tr>                                                                       
        </table> </form>                                                                 
                                                                           
 <center>                                                   
<textarea rows="10" name="S1" cols="75">查询实例:     
  1.select * from asset,class where asset.sum=class.class_id        
  2.select * from asset where name like '%电%' order by id desc         
  3.select * from asset where name=''
  4.select * from asset where name<>'' 
  5.select * from asset where sum is not null 
  6.select * from asset where sum is null  'null不等于''
  7.select * from asset where dat>#2001-7-20#   
  8.select max(sum) as 最大值,min(sum) as 最小值,sum(sum) as 总和,avg(sum) as 平均值,count(sum) as 记录数,count(*) as 总记录数 from asset        
  9.select * from asset where name like '__'   '找两个字符的记录
  10.select * from asset where name like '%电%' and name like '%脑%'       
  增加,修改,删除实例:       
  1.insert into asset(name,sum,dat,pass) values('电器',24,#2001-8-8#,1)        
  2.update asset set pass=0 where pass=1        
  3.delete from asset where name='电视' and pass=true      
 
  创建,删除,增加字段实例:      
  1.CREATE TABLE test (数字 int NOT NULL,文本 text (250),日期 datetime,备注 memo,是否 bit,primary key(数字))
  2.DROP TABLE test '删除表
  3.ALTER TABLE test ADD sum int,tt text (50)  '增加字段sum和tt  
                 
</textarea>                                                  
                                                   
                                                                   
  <br>                                                     
                      版权所有 <a href='mailto:hfh315@sina.com'>湖北荆州贝斯特网络科技有限公司-黄风华</a>                                                      
                      &nbsp;<br>                                                    
                      制作 Copyright&copy; 2001<br>                                                     
SQL学习宝2.0 2001.9.5</center>                                                    
<!-- #include file="sub.asp" -->                                                                     
</body>                                                        
</html>                                                                           

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -