|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
check if table is emptyHow do I check if a table is empty in access?
I need to run different VB depending on if a certain table is empty or not. Thanks! On 27 Dec 2006 07:59:01 -0800, andrew***@gmail.com wrote:
> How do I check if a table is empty in access? You could do a select count on the table to determine the number of records> > I need to run different VB depending on if a certain table is empty or > not. > > Thanks! .... Load the table in your dataadapter and then
If dstest.Tables(0).Rows.Count = -1 Then MsgBox("EMPTY") End If <andrew***@gmail.com> wrote in message Show quoteHide quote news:1167235141.819331.186810@79g2000cws.googlegroups.com... > How do I check if a table is empty in access? > > I need to run different VB depending on if a certain table is empty or > not. > > Thanks! > Hi,
you could try either dim dt as datatable if dt.columns.count=0 then msgbox("Table has no columns") or dt.rows.count=0 then msgbox ("Table has no rows.") depending on your meaning of 'empty' HTH Martin <andrew***@gmail.com> wrote in message Show quoteHide quote news:1167235141.819331.186810@79g2000cws.googlegroups.com... > How do I check if a table is empty in access? > > I need to run different VB depending on if a certain table is empty or > not. > > Thanks! > Use the COUNT SQL function to return a count of rows. If the result is zero,
the table is empty. SELECT COUNT(*) FROM Table1 ----- Tim Patrick - www.timaki.com Start-to-Finish Visual Basic 2005 Show quoteHide quote > How do I check if a table is empty in access? > > I need to run different VB depending on if a certain table is empty or > not. > > Thanks! > |
|||||||||||||||||||||||