Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Newbie question: How to check for a tables existence in a smart (fast) way ??

Re: Newbie question: How to check for a tables existence in a smart (fast) way ??

From: Dev Ashish <dash10_at_hotmail.com>
Date: 1998/01/08
Message-ID: <6938a6$2vh@newsb.netnews.att.com>#1/1

Hi,

You can use the following function
Function TableExists(strTableName As String) As Boolean

    ' This procedure returns True or False depending on whether     ' the table named in strTableName exists.     Dim dbs As Database, tdf As TableDef

    On Error Resume Next
    Set dbs = CurrentDb
    Set tdf = dbs.TableDefs(strTableName)     If Err = 3265 Then

        ' Table does not exist.
        TableExists = False
    Else
        ' Table exists.
        TableExists = True

    End If
    Err = 0
End Function

HTH

--
Dev Ashish
---------------
Check these out before posting your questions........
Hit F1 when using Access. It REALLY helps!!!!!!
http://www.dejanews.com - Have you been here today??
http://www.reference.com - Alternate for searching newsgroups.
http://www.altavista.digital.com/ - Search web/usenet posts.
http://www.microsoft.com/kb/default.asp - Get your answers here!!
--------------





Jørgen Haukland wrote in message <6935n9$nrp_at_info.telenor.no>...

>Hey !
>
>I'm working on an application and need to create some tables if they don't
>already exists - sometimes they do. I've tried to find a smart SQL
statement
>but i end up with something that lists smaller or larger parts of the
table.
>This is no good solution because this table can occasionally be quite large
>(50 - 60 MB). I need a statement that don't do any searching in the table,
>just sees if it's there.
>
>Any suggestions ??
>
>Private e-mails are welcome as long as they also are submitted to the
group.
>
>Joergen Haukland
>NORWAY
>
>e-mail: jorgen.haukland_at_fou.telenor.no
>
>
Received on Thu Jan 08 1998 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US