WHAT IS THE WAY FOR FINDING OUT WHETHER A TABLE EXISTS IN THE MICROSOFT ACCESS DATABASE?

Ashish Pandey

Total Post:128

Points:898
Posted by  Ashish Pandey
 2077  View(s)
Ratings:
Rate this:
Hi Guys
Can someone tell me
what is the way for finding out whether a table exists in the Microsoft Access database?

Thanks

  1. AVADHESH PATEL

    Post:604

    Points:4228
    Re: What is the way for finding out whether a table exists in the Microsoft Access database?

    hi ashish,

    given query solve your problem....

    Dim db As Database
    Dim i As Integer
        Set db = DBEngine.Workspaces(0).Databases(0)
        fExistTable = False
        db.TableDefs.Refresh
        For i = 0 To db.TableDefs.Count - 1
            If strTableName = db.TableDefs(i).Name Then
                'Table Exists
                fExistTable = True
                Exit For
            End If
        Next i

  1. Ashish Pandey

    Post:128

    Points:898
    Re: What is the way for finding out whether a table exists in the Microsoft Access database?

    This is solve my problem!
    Thanks Avadhesh

      Modified On Apr-20-2016 01:36:29 AM

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!