Table Is Exist ??


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Table Is Exist ??

  1. #1
    Hamad Guest

    Table Is Exist ??



    Dear Sir

    How Can I Examine The Table If It's Already Exist Or Not In Access 97

    DataBase Using Visual Basic Ent 5.0

    Thanks Lot
    Hamad

  2. #2
    Larry Rebich Guest

    Re: Table Is Exist ??

    Hamand:

    If you are using DAO then this will work:

    Private Sub Form_Load()
    Dim db As Database
    Set db = OpenDatabase("C:\MyFolder\MyDatabase.mdb")
    If TableExists(db, "myTable") Then
    MsgBox "Table myTable Exists"
    Else
    MsgBox "Table myTable Does Not Exist"
    End If
    End Sub

    Private Function TableExists(db As Database, sTable As String) As Boolean
    Dim tbl As TableDef
    On Error GoTo TableExistsExit
    Set tbl = db.TableDefs(sTable)
    TableExists = True
    Exit Function
    TableExistsExit:
    End Function

    Cheers,
    Larry Rebich

    More tips link to:
    http://www.buygold.net/tips.html

    Please:
    No personal e-mail questions :-)


    "Hamad" <alawadh@hotmail.com> wrote in message
    news:3aef0ed1$1@news.devx.com...
    >
    >
    > Dear Sir
    >
    > How Can I Examine The Table If It's Already Exist Or Not In Access 97
    >
    > DataBase Using Visual Basic Ent 5.0
    >
    > Thanks Lot
    > Hamad




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center