5813.html
来自「以电子书的形式收集了VB一些常见问题解决方法,可以很方便的查找自己需要解决的问题」· HTML 代码 · 共 34 行
HTML
34 行
<html>
<head>
<title>有关 SQL 的一个问题?</title>
</head>
<body bgcolor="#FFFFFF" vlink="#808080">
<center>
<h1>有关 SQL 的一个问题?</h1>
</center>
<hr size=7 width=75%>
<hr size=7 width=75%><p>
Posted by <a href="mailto:kkcheung@resolink.com">kkcheung</a> on September 20, 1998 at 10:39:02:<p>
如有一个 recordset名(tempset1),内有十个records,其中一个fields是记录客户代号,当设定为 temp_d1=tempset1.fields!cust_code<p>再以 temp_d1 去查询另一个资料档相同的客户代号(cust_code).<br>如果我想重复执行,便在程式开始时加上while not ......wend<br>程式如下,问题是这做法会太慢吗?每次movenext后,都要再去设定新的查询条件(temp_st2),可有方法简化?<p>temp_st1="select * from sale_rec where date='19980912"<br>tempset1=openrecordset ".................."<p>while not tempset1.eof<br>temp_d1=tempset1.fields!cust_code<p> temp_st2="select * from customer where cust_code ='"+temp_d1+"'"<br> tempset2=openrecordset "................"<br> temp_d2=tempset2.fields!cust_name<br>tempset1.movenext<br>wend<p>
<br>
<br><hr size=7 width=75%><p>
<a name="followups">Follow Ups:</a><br>
<ul><!--insert: 5813-->
<!--top: 5832--><li><a href="5832.html">试试看 Join</a> <b>小吴</b> <i>07:42:07 9/21/98</i>
(<!--responses: 5832-->2)
<ul><!--insert: 5832-->
<!--top: 5838--><li><a href="5838.html">Re: 试试看 Join</a> <b>kkcheung</b> <i>09:55:41 9/21/98</i>
(<!--responses: 5838-->1)
<ul><!--insert: 5838-->
<!--top: 5980--><li><a href="5980.html">Re: 试试看 Join</a> <b>David Wong</b> <i>14:03:24 9/24/98</i>
(<!--responses: 5980-->0)
<ul><!--insert: 5980-->
</ul><!--end: 5980-->
</ul><!--end: 5838-->
</ul><!--end: 5832-->
</ul><!--end: 5813-->
<br><hr size=7 width=75%><p>
</body></html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?