Determining Table Length in Visual Basic

G

Guest

I want a button to determine the table length (as an integer) of a table in
my database using visual basic. Any ideas on how to do this (is there a
length or size function for this?)
 
B

Brendan Reynolds

What do you mean by the 'length' of a table? If you mean the number of
records, then DCount("*", "NameOfTableHere") will get that. With local
tables you can also use CurrentDb.TableDefs("NameOfTableHere").RecordCount,
but that will return -1 for linked tables.
 
D

dbahooker

dcount

shit friggin retard

a) migrate your shit to access
b) you can get a count of records without scanning the whole table if
you refer to sysindexes I believe. it should be up to date if you
refresh stats occassionaly.

I've never had a problem with it being out of date.

-Aaron
 
D

dbahooker

dcount

shit friggin retard

a) migrate your shit to access data projects -- as in SQL Server
b) you can get a count of records without scanning the whole table if
you refer to sysindexes I believe. it should be up to date if you
refresh stats occassionaly.

I've never had a problem with it being out of date.

-Aaron
 
D

dbahooker

ACCESS DATA PROJECTS i meant sorry

it's 100 times more efficent then a select count(*) or any of your
dcount horseshit
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top