Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

domain functions in a split db

Status
Not open for further replies.

spizotfl

MIS
Aug 17, 2005
345
US
i have read that, if possible, you should avoid the use of domain functions in a split access database for performance reasons. if i want to get those sorts of results should i write a more specialized function that accomplishes roughly the same thing? or is it the general type of function that would degrade performance?
i have written a basic function to replace DCount. it is tailored to the one situation in which it will be needed within our system, but isn't too usable otherwise. if i made it more general purpose, and closer to the usage of DCount , would i run into those same performance issues, or are those more of an issue with microsoft's implementation of these functions?
thanks for any thoughts or comments
 
Domain is nothing more than the table or query that is in the db, and is to be used for the counting. You can replace it with a dynamic sql statement and return the results. The performance hit will result in calling the function, and is personal experience that dictates its use. Have you tried DCount to see if it has problems?

Generic routine:
Function getCount( field as string, table as string, filter as string) as long
strSql = "Select Count(" & field & ") as cnt From " & table & " Where " & filter
set rs = currentdb.openrecordset( strsql, dbopensnapshot)
getcount = rs!cnt
rs.close
ie. strsql should look like this
SELECT Count([CID]) AS FROM CONTACT WHERE CONTACT.Contact Like "A*";
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top