ASP与数据库

Michael 2000-02-18 10:53:00
本人想开始编写B/S系统,不知从ASP开始不知是否可行?请各位专家提供宝贵经验,最好能告知使用的工具及相关的资料(有例题)。
...全文
235 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
cloud 2000-02-19
  • 打赏
  • 举报
回复
对VB和VBSCRIPT很熟的话很快可一上手。给你一份资料吧。
zdg 2000-02-18
  • 打赏
  • 举报
回复
我建议你还是找本ASP和数据库的书看看, 这里很难全面阐述, 你的问题至少要有一本书来回答...
经验是有的:
1)ASP可以编写B/S, 如果你对VB或VB Script有点了解, 开发效率会很快.
2)数据库的选择要适当, 小的系统用Access就可以了, 大的可以考虑使用SQL Server.
3)ASP开发工具: Visual InterDev在Visual Studio中包含...
wenjianzhang 2000-02-18
  • 打赏
  • 举报
回复
关于ASP的书很多,但最好是看OP4的在线文档中的ASP部份,这里提供一个小例子,供参考。
<html>

<head>
<link rel="stylesheet" type="text/css" href="mystyle.css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<style>
<!--
A:link {text-decoration: none; color: blue; }
A:visited {text-decoration: none; color: blue;}
A:active {text-decoration: none; font-family:宋体;color:green;}
A:hover {text-decoration: underline; color: green;}
-->
</style>
</head>

<body bgcolor="#669999">
<% if isempty(request.querystring("year")) then
session("year")=year(date())
else
session("year")=request.querystring("year")
end if


if isempty(Request.QueryString ("lx")) then
session("lx")="xssl"
else
session("lx")=request.querystring("lx")
end if
%>
<%
if request.form("year")<>0 then
session("year")=request.form("year")
end if

if session("lx")="xssl" then
session("lxmc")="销售量"
else
session("lxmc")="销售额"
end if
%>
<%
'定义连接
set Conn=server.CreateObject("adodb.connection")

'打开ODBC
conn.Open "jsyc_xgs","jsyc_xgs","jsyc_xgs"
if isempty(request.querystring("wddm")) then
sql1 ="select * from gsxx"
else
sql1="select * from wdxx_hz where wddm like '"&request.querystring("wddm")&"'"
end if
set rs1=conn.execute(sql1)
session("wddm")=rs1("wddm")
session("wdmc")=rtrim(rs1("wdmc"))
session("sndm")=left(session("wddm"),2)


%>
<%

if isempty(request.querystring("jydm")) then
session("dm")=""
elseif request.querystring("jydm")="2" then
session("dm")=session("sndm")
else
session("dm")=request.querystring("jydm")
end if


if isempty(Request.querystring("jydm")) or (len(Request.QueryString ("jydm"))=1 and Request.QueryString ("jydm")="1") then
session("jymc")="卷烟"
elseif len(Request.QueryString ("jydm"))=1 or Request.querystring("jydm")=session("sndm") then
session("jymc")=Request.QueryString ("jymc")
elseif len(Request.QueryString ("jydm"))=2 then
session("jymc")=Request.QueryString ("jymc")&"产烟"
elseif len(Request.QueryString ("jydm"))=4 then
session("jymc")=Request.QueryString ("jymc")&"产卷烟"
elseif len(Request.QueryString ("jydm"))=6 then
session("jymc")=Request.QueryString ("jymc")&"系列烟"
elseif len(Request.QueryString ("jydm"))=8 then
session("jymc")=Request.QueryString ("jymc")
end if
sql="exec jhb2_Proc '"&session("year")&"'"
set rs=conn.execute(sql)

%>
<div align="left">

<table border="0" width="750" height="0.8">
<tr>
<td width="738" height="0.5"><p align="center"><font face="宋体" size="5"><strong><span
style="color: rgb(255,0,0)"><%=session("wdmc")%><%=session("jymc")%><%=session("lxmc")%>分月统计表</span></strong></font></td>
</tr>
</table>
</div>

<p><a href="jsyc.htm"><img src="Nav_Home.gif" width="78" height="25"
alt="Nav_Home.gif (2996 字节)" border="0" align="right"></a><br>
</p>

<table width="753" height="21">
<tr>
<td width="353" height="12"><form name="dqxs" action="xs_fytjb.asp" method="post">
<p><big>年份: </big><%
aa=session("year")
Response.write("<input NAME=year TYPE=TEXT MAXLENGTH=10 TITLE='输入要查询的年份' size=10 value="&aa&">")
%> <input name="submitok" type="submit" value="确定"
style="font-family:宋体;font-size:9pt" title="单击按钮"></p>
</form>
</td>
<td width="546" height="12"></td>
<td width="238" height="12"></td>
</tr>
</table>

<table border="1" width="100%" bgcolor="#F7EFDE" cellspacing="0">
<tr bgcolor="#00FF00">
<td width="13%" align="center"> </td>
<td width="5%" align="center">合计</a></td>
<td width="4%" align="center" >一月</a></td>
<td width="6%" align="center" >二月</a></td>
<td width="6%" align="center">三月</a></td>
<td width="6%" align="center" >四月</a></td>
<td width="6%" align="center" >五月</a></td>
<td width="6%" align="center" >六月</a></td>
<td width="6%" align="center" >七月</a></td>
<td width="6%" align="center" >八月</a></td>
<td width="6%" align="center" >九月</a></td>
<td width="6%" align="center">十月</a></td>
<td width="6%" align="center" >十一月</a></td>
<td width="6%" align="center">十二月</a></td>
</tr>
<% do while not rs.eof %>
<tr bgcolor="f7efde">
<td width="13%" align="left"><%=rs("dmmc")%>
<td width="4%" align="right"><%=rs("hj")%> </td>
<td width="4%" align="right"><%=rs("sl1")%> </td>
<td width="4%" align="right"><%=rs("sl2")%> </td>
<td width="4%" align="right"><%=rs("sl3")%> </td>
<td width="4%" align="right"><%=rs("sl4")%> </td>
<td width="4%" align="right"><%=rs("sl5")%> </td>
<td width="4%" align="right"><%=rs("sl6")%> </td>
<td width="4%" align="right"><%=rs("sl7")%> </td>
<td width="4%" align="right"><%=rs("sl8")%> </td>
<td width="4%" align="right"><%=rs("sl9")%> </td>
<td width="4%" align="right"><%=rs("sl10")%> </td>
<td width="4%" align="right"><%=rs("sl11")%> </td>
<td width="4%" align="right"><%=rs("sl12")%> </td>
</tr>
<%
rs.movenext
loop
Rs.Close
rs1.close
conn.Close
set Rs=nothing
set Rs1=nothing
set conn=nothing

%>
</table>
</body>
</html>


Michael 2000-02-18
  • 打赏
  • 举报
回复
回复zdg,本人对VB及VB Script都很熟悉,就是不知从何处入手。你能否给出资料的名称与出处及一些小例程作参考?

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧