[英]DLookup: query vs. table in MS Access VBA?
What is the difference between these two lines of code in MS Access VBA. MS Access VBA中的这两行代码有什么区别? does it really make a difference?
真的有什么不同吗?
Facts: 事实:
- --
DLookup("EmployeeID", "qryA", "[EmployeeID]=" & Me.empID) & "" = ""
vs 与
DLookup("EmployeeID", "tblLogin", "[EmployeeID]=" & Me.empID) & "" = ""
are there any restrictions that makes us want to go create a query identical to a table? 是否有任何限制使我们想要创建与表相同的查询?
In DLookup? 在DLookup中? I've never encountered a difference.
我从未遇到过任何不同。 Pretty sure performance is the same.
可以肯定的是性能是相同的。 The advantages I can think of to using a query are unrelated to performance:
我可以想到的使用查询的优势与性能无关:
First of all, your question should say that you mean using DLookUp
. 首先,您的问题应该说您的意思是使用
DLookUp
。
Second, in the case of DLookup, no, there is no difference. 其次,在DLookup的情况下,没有区别。
But to be honest, just in that case. 但老实说,就是在这种情况下。 Queries are, with no doubt, more helpful to work with.
毫无疑问,查询会更有用。 Queries allow you to call for data in the way you want, sorted, with different parameters, grouping data (even from different tables).
通过查询,您可以以所需的方式调用数据,并使用不同的参数对数据进行分组(甚至来自不同的表)。
To make it really simple, a table is like a store, where you save your goodies, and the query would be like a smart worker that gets for you in seconds the info the customer needs (or the boss), and this worker can adapt to any need. 简单地说,表就像商店,您可以在其中保存好吃的东西,查询就像一个聪明的工作人员,可以在几秒钟内为您提供客户(或老板)所需的信息,并且该工作人员可以适应任何需要。
That's my POV, anyways. 无论如何,那是我的观点。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.