How to find out if table contains data? 
Author Message
 How to find out if table contains data?

Hi,
I'm writing an application in which the records of various tables of one and
the same database are being manipulated. However, the corresponing procedures
should only be executed, if the tables contains any records/data. Thus
I need something like

If "table contains data" then
  procedure1
  procedure2
  .
  .
Else
  Exit Sub
End If

Can anyone tell me how to determine if a table contains data.

Thanks
Sascha
(Sascha W. Felix)



Wed, 24 Dec 1997 03:00:00 GMT  
 How to find out if table contains data?
Hi, Sascha:

When you open the table, check if both table.EOF and table.BOF are TRUE.  If
both are true, then it's an empty table.



Quote:
>Hi,
>I'm writing an application in which the records of various tables of one and
>the same database are being manipulated. However, the corresponing procedures
>should only be executed, if the tables contains any records/data. Thus
<snip>
>Thanks
>Sascha
>(Sascha W. Felix)




Wed, 24 Dec 1997 03:00:00 GMT  
 How to find out if table contains data?


Quote:
>Can anyone tell me how to determine if a table contains data.

Try this:

DIM Empty%
DatabaseObject.Refresh

if DatabaseObject.Recordset.RecordCount = 0 THEN Empty% = 1

Sounds good? That's what I did. Works perfectly.



Wed, 24 Dec 1997 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. The problem to find a data contain '

2. The problem to find a data contain '

3. normalising table with a fields containing CSV data

4. Function to return data contained in a table

5. Normalizing non-normal tables already containing data;OR changing columns into rows

6. Finding Data in a Table

7. Finding records in Access tables with help of data conmtrols

8. How to find and delete continuous blocks of data from a table

9. ADO data control 'cannot find table'

10. Display a blank screen if picture data is not found in sql table

11. open a table read the contains and create an access report that will print the contains of my table

12. Find whether a string has a CRLF contained within it

 

 
Powered by phpBB® Forum Software