如何使用dcount加速此功能? [英] how can I speed up this function with a dcount in it?

查看:55
本文介绍了如何使用dcount加速此功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我希望我不会因为问太多问题而被禁止。我只是

非常高兴有这个平台;-)


我有以下功能:

功能IsProperty(pptname )如布尔值


-------------------

如果DCount([ID] "," [T-TCP]"," [T-TCP]![D] =''"& pptName&"''")> 0然后

IsProperty =真

否则

IsProperty = False

结束如果

结束功能

-------------------


因此T-TCP是一个表格一个属性列表(大约100)。我怎么能用
来加速这个功能?

我的dbs中的几个函数多次调用这个函数,同时格式化

表格。


---

如果(a)此邮件

包含病毒,请立即通知我们(通过电话或回复邮件) br />
(b)您不是预定的收件人

(c)您认为此电子邮件是垃圾邮件。

我们已尽最大努力确保

以上都不适用。谢谢

由AVG反病毒系统检查( http:// www .grisoft.com)

版本:6.0.698 /病毒库:455 - 发布日期:02/06/2004

解决试用

试试这个:

函数IsProperty(pptname)为布尔值

dim db为Dao.database

dim rst作为Dao.recordset

dim strSQL as string

set db = currentdb

strSQL =" SELECT Count([ID])AS Properties FROM T-TCP _

& WHERE [D] =""" &安培; pptname& """"

set rst = db.openrecordset(strSQL)

rst

If!Properties> 0然后

IsProperty =真

否则

IsProperty = False

结束如果

结束

错误继续下一步

rst.close

set rst = nothing

set db = nothing

结束功能


斯图尔特


" WindAndWaves" <交流**** @ ngaru.com>在消息中写道

新闻:0J ****************** @ news.xtra.co.nz ...

大家好,

我希望我不会因为问太多问题而被禁止。我只是很高兴有这个平台;-)

我有以下功能:
功能IsProperty(pptname)为布尔

- ------------------
如果是DCount([ID],[T-TCP],[T-TCP] ![D] =''"& pptName&"''")> 0然后
IsProperty = True
其他
IsProperty = False
结束如果
结束功能
------------- ------

因此,T-TCP是一个包含属性列表的表(大约100个)。我怎样才能加速这个功能呢?

我的dbs中的几个函数多次调用这个函数,而
格式化表格。


---
如果(a)这封
邮件包含病毒,请立即告知我们(通过电话或回复邮件)
(b)您不是预定的收件人
(c)您认为此电子邮件是垃圾邮件。
我们已尽最大努力确保上述任何一项都不适用。谢谢
由AVG反病毒系统检查( http://www.grisoft.com )
版本:6.0.698 /病毒数据库:455 - 发布日期:02/06/2004



< blockquote>我会尝试...再次感谢你。


" Stewart Allen" < SA **** @ NOT.wave.THIS.co.nz>在留言中写道

news:ca ********** @ news.wave.co.nz ...

试试这个:
函数IsProperty(pptname)as Boolean
dim db as Dao.database
dim rst as Dao.recordset
dim strSQL as string
set db = currentdb
strSQL =" ; SELECT Count([ID])AS Properties FROM T-TCP" _
& WHERE [D] =""" &安培; pptname& """"
设置rst = db.openrecordset(strSQL)
使用rst
If!Properties> 0然后
IsProperty = True
其他
IsProperty = False
结束如果
结束
On Error Resume Next
rst.close
set rst = nothing
set db = nothing
结束功能

斯图尔特

WindAndWaves <交流**** @ ngaru.com>在消息中写道
新闻:0J ****************** @ news.xtra.co.nz ...

大家好,

我希望我不会因为问太多问题而被禁止。我只是很高兴有这个平台;-)

我有以下功能:
功能IsProperty(pptname)为布尔

- ------------------
如果是DCount([ID],[T-TCP],[T-TCP] ![D] =''"& pptName&"''")> 0然后
IsProperty = True
其他
IsProperty = False
结束如果
结束功能
------------- ------

因此,T-TCP是一个包含属性列表的表(大约100个)。怎么能
我加速这个功能?

我的dbs中的几个函数多次调用这个函数,而


格式化

表格。


---
如果(a)这个


电子邮件

包含病毒
(b)您不是预定的收件人
(c)您认为此电子邮件是垃圾邮件。
我们已尽最大努力确保由AVG反病毒系统检查( http://www.grisoft.com )
版本:6.0.698 /病毒数据库:455 - 发布日期:02/06/2004




---

如果(a)此邮件

包含病毒,请立即通知我们(通过电话或回复邮件)

(b)您不是预定的收件人

(c)您认为此电子邮件是垃圾邮件。

我们已尽最大努力确保

以上都不适用。谢谢

由AVG反病毒系统检查( http:// www .grisoft.com)

版本:6.0.698 /病毒库:455 - 发布日期:02/06/2004


< blockquote>

" WindAndWaves" <交流**** @ ngaru.com>在消息中写道

新闻:0J ****************** @ news.xtra.co.nz ...

大家好,

我希望我不会因为问太多问题而被禁止。我只是很高兴有这个平台;-)

我有以下功能:
功能IsProperty(pptname)为布尔

- ------------------
如果是DCount([ID],[T-TCP],[T-TCP] ![D] =''"& pptName&"''")> 0然后
IsProperty = True
其他
IsProperty = False
结束如果
结束功能
------------- ------

因此,T-TCP是一个包含属性列表的表(大约100个)。我怎样才能加快这个功能呢?




首先,看起来你应该使用DLookup代替DCount

因为你真的不想计算价值存在的次数

就好像存在一样。


如果你解释为什么你这么做''使用这个函数来格式化一个表单,那么

可能是一个更好的方式来获取你要去的地方。也许在记录集中返回所有单个

查找并使用FindFirst。


Hi everyone,

I hope I will not get banned for asking toooo many questions. I am just
really excited to have this platform ;-)

I have the following function:
Function IsProperty(pptname) as boolean

-------------------
If DCount("[ID]", "[T-TCP]", "[T-TCP]![D]=''" & pptName & "''") > 0 Then
IsProperty = True
Else
IsProperty= False
end if
End function
-------------------

Thereby T-TCP is a table with a list of properties (about 100). How can I
speed up this function?
Several functions in my dbs call this function many times, while formatting
forms.

---
Please immediately let us know (by phone or return email) if (a) this email
contains a virus
(b) you are not the intended recipient
(c) you consider this email to be spam.
We have done our utmost to make sure that
none of the above are applicable. THANK YOU
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.698 / Virus Database: 455 - Release Date: 02/06/2004

解决方案

Try this:
Function IsProperty(pptname) as Boolean
dim db as Dao.database
dim rst as Dao.recordset
dim strSQL as string
set db=currentdb
strSQL = "SELECT Count([ID]) AS Properties FROM T-TCP " _
& "WHERE [D] = """ & pptname & """;"
set rst = db.openrecordset(strSQL)
With rst
If !Properties > 0 Then
IsProperty = True
Else
IsProperty = False
End If
End With
On Error Resume Next
rst.close
set rst = nothing
set db = nothing
End Function

Stewart

"WindAndWaves" <ac****@ngaru.com> wrote in message
news:0J******************@news.xtra.co.nz...

Hi everyone,

I hope I will not get banned for asking toooo many questions. I am just
really excited to have this platform ;-)

I have the following function:
Function IsProperty(pptname) as boolean

-------------------
If DCount("[ID]", "[T-TCP]", "[T-TCP]![D]=''" & pptName & "''") > 0 Then
IsProperty = True
Else
IsProperty= False
end if
End function
-------------------

Thereby T-TCP is a table with a list of properties (about 100). How can I
speed up this function?
Several functions in my dbs call this function many times, while formatting forms.

---
Please immediately let us know (by phone or return email) if (a) this email contains a virus
(b) you are not the intended recipient
(c) you consider this email to be spam.
We have done our utmost to make sure that
none of the above are applicable. THANK YOU
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.698 / Virus Database: 455 - Release Date: 02/06/2004



I will try that... Thank you once more.

"Stewart Allen" <sa****@NOT.wave.THIS.co.nz> wrote in message
news:ca**********@news.wave.co.nz...

Try this:
Function IsProperty(pptname) as Boolean
dim db as Dao.database
dim rst as Dao.recordset
dim strSQL as string
set db=currentdb
strSQL = "SELECT Count([ID]) AS Properties FROM T-TCP " _
& "WHERE [D] = """ & pptname & """;"
set rst = db.openrecordset(strSQL)
With rst
If !Properties > 0 Then
IsProperty = True
Else
IsProperty = False
End If
End With
On Error Resume Next
rst.close
set rst = nothing
set db = nothing
End Function

Stewart

"WindAndWaves" <ac****@ngaru.com> wrote in message
news:0J******************@news.xtra.co.nz...

Hi everyone,

I hope I will not get banned for asking toooo many questions. I am just
really excited to have this platform ;-)

I have the following function:
Function IsProperty(pptname) as boolean

-------------------
If DCount("[ID]", "[T-TCP]", "[T-TCP]![D]=''" & pptName & "''") > 0 Then
IsProperty = True
Else
IsProperty= False
end if
End function
-------------------

Thereby T-TCP is a table with a list of properties (about 100). How can I speed up this function?
Several functions in my dbs call this function many times, while


formatting

forms.

---
Please immediately let us know (by phone or return email) if (a) this


email

contains a virus
(b) you are not the intended recipient
(c) you consider this email to be spam.
We have done our utmost to make sure that
none of the above are applicable. THANK YOU
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.698 / Virus Database: 455 - Release Date: 02/06/2004



---
Please immediately let us know (by phone or return email) if (a) this email
contains a virus
(b) you are not the intended recipient
(c) you consider this email to be spam.
We have done our utmost to make sure that
none of the above are applicable. THANK YOU
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.698 / Virus Database: 455 - Release Date: 02/06/2004



"WindAndWaves" <ac****@ngaru.com> wrote in message
news:0J******************@news.xtra.co.nz...

Hi everyone,

I hope I will not get banned for asking toooo many questions. I am just
really excited to have this platform ;-)

I have the following function:
Function IsProperty(pptname) as boolean

-------------------
If DCount("[ID]", "[T-TCP]", "[T-TCP]![D]=''" & pptName & "''") > 0 Then
IsProperty = True
Else
IsProperty= False
end if
End function
-------------------

Thereby T-TCP is a table with a list of properties (about 100). How can I
speed up this function?



First off, it looks like you should be using DLookup instead of DCount
since you don''t really want to count the number of times the value exists
just if it exists at all.

Second if you explain why you''re using the function to format a form, there
may be a better way to get where you''re going. Maybe return all the single
lookups in a recordset and use FindFirst.


这篇关于如何使用dcount加速此功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆