PC Review


Reply
Thread Tools Rate Thread

Count number of records in all tables in a database

 
 
=?Utf-8?B?R2Vvcmdl?=
Guest
Posts: n/a
 
      11th Apr 2006
Hello, how do I count the number of records in all tables in a certain
database. I need a list with table name and count.

Thanks in advance.

George
 
Reply With Quote
 
 
 
 
RoyVidar
Guest
Posts: n/a
 
      11th Apr 2006
George wrote in message
<891DE1F0-9078-40D7-8E2D-(E-Mail Removed)> :
> Hello, how do I count the number of records in all tables in a
> certain database. I need a list with table name and count.
>
> Thanks in advance.
>
> George


dim td as dao.tabledef
for each td in currentdb.tabledefs
debug.print td.name, td.recordcount
next td

Hit ctrl+g to see the results. Note - to avoid showing system tables
etc
you might consider testing whether left$(td.name, 4) <> "MSYS", and I
think the linked tables might show -1.

--
Roy-Vidar


 
Reply With Quote
 
RoyVidar
Guest
Posts: n/a
 
      11th Apr 2006
George wrote in message
<A4A5DDF2-A999-468F-9597-(E-Mail Removed)> :
> Roy, I'm new to Access. I do not want the system tables in the count
> where do but the left$(td.name, 4) <> "MSYS" in the code. Thanks
> Again
>
> "RoyVidar" wrote:
>
>> George wrote in message
>> <891DE1F0-9078-40D7-8E2D-(E-Mail Removed)> :
>>> Hello, how do I count the number of records in all tables in a
>>> certain database. I need a list with table name and count.
>>>
>>> Thanks in advance.
>>>
>>> George

>>
>> dim td as dao.tabledef
>> for each td in currentdb.tabledefs
>> debug.print td.name, td.recordcount
>> next td
>>
>> Hit ctrl+g to see the results. Note - to avoid showing system tables
>> etc
>> you might consider testing whether left$(td.name, 4) <> "MSYS", and
>> I think the linked tables might show -1.
>>
>> --
>> Roy-Vidar
>>
>>
>>


Perhaps something like this:

dim td as dao.tabledef
for each td in currentdb.tabledefs
if left$(td.name, 4) <> "MSYS" then
debug.print td.name, td.recordcount
end if
next td

--
Roy-Vidar


 
Reply With Quote
 
=?Utf-8?B?R2Vvcmdl?=
Guest
Posts: n/a
 
      11th Apr 2006
Roy, I'm new to Access. I do not want the system tables in the count where
do but the left$(td.name, 4) <> "MSYS" in the code. Thanks Again

"RoyVidar" wrote:

> George wrote in message
> <891DE1F0-9078-40D7-8E2D-(E-Mail Removed)> :
> > Hello, how do I count the number of records in all tables in a
> > certain database. I need a list with table name and count.
> >
> > Thanks in advance.
> >
> > George

>
> dim td as dao.tabledef
> for each td in currentdb.tabledefs
> debug.print td.name, td.recordcount
> next td
>
> Hit ctrl+g to see the results. Note - to avoid showing system tables
> etc
> you might consider testing whether left$(td.name, 4) <> "MSYS", and I
> think the linked tables might show -1.
>
> --
> Roy-Vidar
>
>
>

 
Reply With Quote
 
=?Utf-8?B?R2Vvcmdl?=
Guest
Posts: n/a
 
      11th Apr 2006
Thank you

"RoyVidar" wrote:

> George wrote in message
> <A4A5DDF2-A999-468F-9597-(E-Mail Removed)> :
> > Roy, I'm new to Access. I do not want the system tables in the count
> > where do but the left$(td.name, 4) <> "MSYS" in the code. Thanks
> > Again
> >
> > "RoyVidar" wrote:
> >
> >> George wrote in message
> >> <891DE1F0-9078-40D7-8E2D-(E-Mail Removed)> :
> >>> Hello, how do I count the number of records in all tables in a
> >>> certain database. I need a list with table name and count.
> >>>
> >>> Thanks in advance.
> >>>
> >>> George
> >>
> >> dim td as dao.tabledef
> >> for each td in currentdb.tabledefs
> >> debug.print td.name, td.recordcount
> >> next td
> >>
> >> Hit ctrl+g to see the results. Note - to avoid showing system tables
> >> etc
> >> you might consider testing whether left$(td.name, 4) <> "MSYS", and
> >> I think the linked tables might show -1.
> >>
> >> --
> >> Roy-Vidar
> >>
> >>
> >>

>
> Perhaps something like this:
>
> dim td as dao.tabledef
> for each td in currentdb.tabledefs
> if left$(td.name, 4) <> "MSYS" then
> debug.print td.name, td.recordcount
> end if
> next td
>
> --
> Roy-Vidar
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Count all records for all tables jez123456 Microsoft ADO .NET 5 3rd Jul 2008 02:48 PM
Count Number of Records and Number of Fields in CSV File ExcelMonkey Microsoft Excel Programming 0 29th Nov 2007 10:58 PM
Count number of records/tuples in a database weird0 Microsoft C# .NET 2 18th Feb 2007 02:58 PM
How can I count records from many tables Kay Microsoft Access Queries 3 20th Mar 2006 07:53 PM
how do i count the number of tables in an access database? =?Utf-8?B?bmF2eSBh?= Microsoft Access VBA Modules 1 7th Sep 2005 04:29 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:30 PM.