ASP连接SQL制作登录注册页面
我用的VS2005,就是怎么连接数据库进行登录,还有注册新信息。最好是源代码,要能用的,网上直接粘的别来,没一个管用的。麻烦仔细说明一下。。。还有就是怎么来限制游客和用户...
我用的VS2005,就是怎么连接数据库进行登录,还有注册新信息。最好是源代码,要能用的,网上直接粘的别来,没一个管用的。 麻烦仔细说明一下。。。 还有就是怎么来限制游客和用户的访问内容,用自带的ASP设置不好用,老师让重新做。。
展开
1个回答
2013-09-02
展开全部
我新建立一conn.asp,在index.asp 调用显示数据:为什么老是出错???
请帮看看!
<%
dim conn
dim strconn
'on error resume next
strconn = "Driver={SQL Server};SERVER=10.97.1.48;UID=sa;PWD=sa;DATABASE=ABRSCAN"
'strconn = "PROVIDER=SQLOLEDB;DATA SOURCE=10.97.1.27;UID=sa;PWD=sa;DATABASE=ABRSCAN"
'strconn = "data source=10.97.1.27;integrated security=SSPI;Database=ABRSCAN"
set conn = server.createobject("adodb.connection")
conn. Properties("Connect Timeout") = 15 '以秒为单位
conn.open strconn
%>
在index.asp 做如下调用显示数据:
<!--#include file="conn.asp"-->
<%
dim rs
set rs = server.createobject("adodb.recordset")
%>
<%
sql="select * from ciginfo "
'sql=sql&"download.id,download.showname,bb,download.dateandtime,download.hits,download.classid,download.Nclassid,Nclass.Nclass "
'sql=sql&" from ciginfo "
'sql=sql&" order by download.dateandtime desc"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
%>
<tr>
<td bgcolor="#ecfaff">没有记录!!!</td>
</tr>
<%else%>
<%
do while not rs.eof
barcode = rs("barcode")
'if(len(name)>26) then name = left(name,26) + "...."
%>
<tr>
<td width="100%" height="24" bgcolor="#ecfaff" > <img src="images/RedArrow.gif" width="4" height="7"> [<%=rs("barcode")%>] <font color='#999999'> <font color=red> <font color='#999999'> </font></font></font><span class="style1"></span></td>
<%
rs.movenext
loop
end if
rs.close
%>
请帮看看!
<%
dim conn
dim strconn
'on error resume next
strconn = "Driver={SQL Server};SERVER=10.97.1.48;UID=sa;PWD=sa;DATABASE=ABRSCAN"
'strconn = "PROVIDER=SQLOLEDB;DATA SOURCE=10.97.1.27;UID=sa;PWD=sa;DATABASE=ABRSCAN"
'strconn = "data source=10.97.1.27;integrated security=SSPI;Database=ABRSCAN"
set conn = server.createobject("adodb.connection")
conn. Properties("Connect Timeout") = 15 '以秒为单位
conn.open strconn
%>
在index.asp 做如下调用显示数据:
<!--#include file="conn.asp"-->
<%
dim rs
set rs = server.createobject("adodb.recordset")
%>
<%
sql="select * from ciginfo "
'sql=sql&"download.id,download.showname,bb,download.dateandtime,download.hits,download.classid,download.Nclassid,Nclass.Nclass "
'sql=sql&" from ciginfo "
'sql=sql&" order by download.dateandtime desc"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
%>
<tr>
<td bgcolor="#ecfaff">没有记录!!!</td>
</tr>
<%else%>
<%
do while not rs.eof
barcode = rs("barcode")
'if(len(name)>26) then name = left(name,26) + "...."
%>
<tr>
<td width="100%" height="24" bgcolor="#ecfaff" > <img src="images/RedArrow.gif" width="4" height="7"> [<%=rs("barcode")%>] <font color='#999999'> <font color=red> <font color='#999999'> </font></font></font><span class="style1"></span></td>
<%
rs.movenext
loop
end if
rs.close
%>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询