链接记录集显示 [英] Linking recordset display
问题描述
我在这里遇到问题,我正在尝试创建一个ASP页面,其中我的记录集具有指向数据库中存在的ID的链接,该ID可以带到我的其他页面,这将删除基于ID的记录
EG ::
AL (id = 1)
油(id = 2)
当用户单击AL时,页面可以捕获值1搜索ADO n删除记录
同样是用户单击OIL,页面捕获值2搜索ASO n删除记录
我已经完成了删除操作,但是我对如何创建链接一无所知.任何帮助吗? :doh::confused::doh:
I have a problem here, i''m trying to create a asp page where my recordset have a link to a id present in the DB which can be brought to my other page which will delete the record base on the ID
EG::
AL(id=1)
OIL(id=2)
when the user click on AL, the page can capture the value 1 search the ADO n delete record
similarly is user click on OIL, the page capture the value 2 search the ASO n delete record
i''ve got the part for deleting done but i''ve no clue on how to create the link.. any help?? :doh: :confused: :doh:
推荐答案
创建两个页面,一个是显示记录,另一个是删除您链接到该记录的数据
例如:
show.page
create two pages,one is show the record,other one is delete your data where you link to the record
eg:
show.page
<br />
<html><br />
<head>..........</head><br />
<br />
<body><br />
Dim sql <br />
sql="select id,title from table"<br />
set rs=conn.execute(sql)//conn is connection object<br />
For i=1 to rs.count<br />
response.write("<a href=''delete.asp?ID="&rs(''id'')&"''>"&rs(''title'')&"</a><br>")<br />
Next<br />
%><br />
</body><br />
<br />
</html><br />
delete.asp
delete.asp
<br />
<%<br />
Dim id<br />
id=request(''ID'')<br />
conn.execute("delete * from table where ID="&ID)<br />
%>
<br />
<br />
<script></script><br />
<br />
<br />
<br />
<br />
<br />
这篇关于链接记录集显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!