一个关于查询的问题 ( 积分: 200 )

H

haoshan

Unregistered / Unconfirmed
GUEST, unregistred user!
我想实现这样一个功能,在下拉列表中输入要查询的文字,随着输入文字的增多,查询的范围越来越小。请问用asp 怎样实现这个功能。
 
我想实现这样一个功能,在下拉列表中输入要查询的文字,随着输入文字的增多,查询的范围越来越小。请问用asp 怎样实现这个功能。
 
ASP是服务器语言,你描述的这个功能属于前台功能,两个不要混淆了,可以用JavaScript搞定的,Asp.net 不是很了解。
 
用iframe试试,以前做过SQL 用Like操作符
<!-- 这个是testa.htm -->
<script>
function submitasp()
{
form1.submit();
}
</script>
<form name=form1 action='testa.asp' target=aspform>
<!--好像退格键不触发,你在看看-->
<Input type=text name=keyfield size=12 onkeyup=&quot;submitasp()&quot;>
<Input type=submit value=ok>
</form>
<iframe name=aspform src=&quot;testa.asp&quot;
frameborder=No left=0 height=350 width=100%
>
</iframe>
================================
<!-- 这个是testa.asp -->
<!--#include file=&quot;asp/images/count/pubinc/pubFunc.asp&quot;-->
<body bgcolor=pink>
<%
dim keyfield, counter, i
'keyfield = Request.Form(&quot;keyfield&quot;)
keyfield = Request.QueryString(&quot;keyfield&quot;)
if trim(keyfield) <> &quot;&quot;
then

tai.open(&quot;select * from cnown.wkcode where rownum < 50 AND codid like '%&quot;&amp;

keyfield &amp;&quot;%'&quot;) 'SQL语句根据你的数据库更改,我的是Oracle查询速度极快,呵呵,但是数据
量大的话,还是不理想
counter = tai.DataSet.fields.Count
do
while not(tai.dataSet.eof)
for i = 0 to counter - 1

Response.write tai.dataSet.fields(i)
next
Response.write &quot;<br>&quot;
tai.dataset.movenext
loop
end if
%>
 
onkeyup=&quot;submitasp()&quot;> or
onkeypress=&quot;submitasp()&quot;>
 
我刚接触asp,对它不是太了解.请多多指教!
<!--#include file=&quot;asp/images/count/pubinc/pubFunc.asp&quot;-->这个文件是不是一个数据库包含文件啊?
tai.open(&quot;select * from cnown.wkcode where rownum < 50 AND codid like '%&quot;&amp;

keyfield &amp;&quot;%'&quot;) 中rownum < 50 起什么 作用啊?
谢谢!!!!!!!!!!!!
 
接受答案了.
 
<!--#include file=&quot;asp/images/count/pubinc/pubFunc.asp&quot;-->是VBScript用原始的ADO封装的Tai.DataSet 对像,就和delphi中的ADOQuery一样!
(&quot;select * from cnown.wkcode where rownum < 50 AND codid like '%&quot;&amp;
keyfield &amp;&quot;%'&quot;)
这是Oracle数据库中的SQL语法, rownum是行号,有点像SQL2000中的Identity ID. 它在这里起到限制行数为<50的作用.
 
顶部