Page 1 of 2 12 LastLast
Results 1 to 15 of 24
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts
    looking into this, thought i'd swing by the lounge...

    in SQL Server, you often do things like If Exists <table> Drop Table <table> as a standard check prior to trying to create the object. In Access, I have tabledef code in place and I want to do the same check to make sure I never try to create a table def if the linked table already exits.

    So, looking for the syntax...

    TIA!

  2. #2
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts
    looking into this, thought i'd swing by the lounge...

    in SQL Server, you often do things like If Exists <table> Drop Table <table> as a standard check prior to trying to create the object. In Access, I have tabledef code in place and I want to do the same check to make sure I never try to create a table def if the linked table already exits.

    So, looking for the syntax...

    TIA!

  3. #3
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts
    looking into this, thought i'd swing by the lounge...

    in SQL Server, you often do things like If Exists <table> Drop Table <table> as a standard check prior to trying to create the object. In Access, I have tabledef code in place and I want to do the same check to make sure I never try to create a table def if the linked table already exits.

    So, looking for the syntax...

    TIA!

  4. #4
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts
    looking into this, thought i'd swing by the lounge...

    in SQL Server, you often do things like If Exists <table> Drop Table <table> as a standard check prior to trying to create the object. In Access, I have tabledef code in place and I want to do the same check to make sure I never try to create a table def if the linked table already exits.

    So, looking for the syntax...

    TIA!

  5. #5
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts
    looking into this, thought i'd swing by the lounge...

    in SQL Server, you often do things like If Exists <table> Drop Table <table> as a standard check prior to trying to create the object. In Access, I have tabledef code in place and I want to do the same check to make sure I never try to create a table def if the linked table already exits.

    So, looking for the syntax...

    TIA!

  6. #6
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts
    looking into this, thought i'd swing by the lounge...

    in SQL Server, you often do things like If Exists <table> Drop Table <table> as a standard check prior to trying to create the object. In Access, I have tabledef code in place and I want to do the same check to make sure I never try to create a table def if the linked table already exits.

    So, looking for the syntax...

    TIA!

  7. #7
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts
    looking into this, thought i'd swing by the lounge...

    in SQL Server, you often do things like If Exists <table> Drop Table <table> as a standard check prior to trying to create the object. In Access, I have tabledef code in place and I want to do the same check to make sure I never try to create a table def if the linked table already exits.

    So, looking for the syntax...

    TIA!

  8. #8
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts
    looking into this, thought i'd swing by the lounge...

    in SQL Server, you often do things like If Exists <table> Drop Table <table> as a standard check prior to trying to create the object. In Access, I have tabledef code in place and I want to do the same check to make sure I never try to create a table def if the linked table already exits.

    So, looking for the syntax...

    TIA!

  9. #9
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    USA
    Posts
    386
    Thanks
    0
    Thanked 0 Times in 0 Posts
    This code could be quickly modified to suit your situation.


    Dim RemoveDB As Database
    Dim strTempTbl As String
    Dim TempTableName As String

    Dim I As Integer

    Set RemoveDB = DBEngine.Workspaces(0).Databases(0)
    TempTableName = "tblTemp" & CurrentUser()

    For I = 0 To RemoveDB.TableDefs.Count - 2
    strTempTbl = RemoveDB.TableDefs(I).Name
    '-----Debug.Print strTempTbl
    '-----MsgBox "Table Name(" & i & ") = " & strtblname

    If strTempTbl Like TempTableName Then
    RemoveDB.TableDefs.Delete strTempTbl

    End If

    Next I


    Hope this helps.
    Richard

  10. #10
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    USA
    Posts
    386
    Thanks
    0
    Thanked 0 Times in 0 Posts
    This code could be quickly modified to suit your situation.


    Dim RemoveDB As Database
    Dim strTempTbl As String
    Dim TempTableName As String

    Dim I As Integer

    Set RemoveDB = DBEngine.Workspaces(0).Databases(0)
    TempTableName = "tblTemp" & CurrentUser()

    For I = 0 To RemoveDB.TableDefs.Count - 2
    strTempTbl = RemoveDB.TableDefs(I).Name
    '-----Debug.Print strTempTbl
    '-----MsgBox "Table Name(" & i & ") = " & strtblname

    If strTempTbl Like TempTableName Then
    RemoveDB.TableDefs.Delete strTempTbl

    End If

    Next I


    Hope this helps.
    Richard

  11. #11
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    USA
    Posts
    386
    Thanks
    0
    Thanked 0 Times in 0 Posts
    This code could be quickly modified to suit your situation.


    Dim RemoveDB As Database
    Dim strTempTbl As String
    Dim TempTableName As String

    Dim I As Integer

    Set RemoveDB = DBEngine.Workspaces(0).Databases(0)
    TempTableName = "tblTemp" & CurrentUser()

    For I = 0 To RemoveDB.TableDefs.Count - 2
    strTempTbl = RemoveDB.TableDefs(I).Name
    '-----Debug.Print strTempTbl
    '-----MsgBox "Table Name(" & i & ") = " & strtblname

    If strTempTbl Like TempTableName Then
    RemoveDB.TableDefs.Delete strTempTbl

    End If

    Next I


    Hope this helps.
    Richard

  12. #12
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    USA
    Posts
    386
    Thanks
    0
    Thanked 0 Times in 0 Posts
    This code could be quickly modified to suit your situation.


    Dim RemoveDB As Database
    Dim strTempTbl As String
    Dim TempTableName As String

    Dim I As Integer

    Set RemoveDB = DBEngine.Workspaces(0).Databases(0)
    TempTableName = "tblTemp" & CurrentUser()

    For I = 0 To RemoveDB.TableDefs.Count - 2
    strTempTbl = RemoveDB.TableDefs(I).Name
    '-----Debug.Print strTempTbl
    '-----MsgBox "Table Name(" & i & ") = " & strtblname

    If strTempTbl Like TempTableName Then
    RemoveDB.TableDefs.Delete strTempTbl

    End If

    Next I


    Hope this helps.
    Richard

  13. #13
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    USA
    Posts
    386
    Thanks
    0
    Thanked 0 Times in 0 Posts
    This code could be quickly modified to suit your situation.


    Dim RemoveDB As Database
    Dim strTempTbl As String
    Dim TempTableName As String

    Dim I As Integer

    Set RemoveDB = DBEngine.Workspaces(0).Databases(0)
    TempTableName = "tblTemp" & CurrentUser()

    For I = 0 To RemoveDB.TableDefs.Count - 2
    strTempTbl = RemoveDB.TableDefs(I).Name
    '-----Debug.Print strTempTbl
    '-----MsgBox "Table Name(" & i & ") = " & strtblname

    If strTempTbl Like TempTableName Then
    RemoveDB.TableDefs.Delete strTempTbl

    End If

    Next I


    Hope this helps.
    Richard

  14. #14
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    USA
    Posts
    386
    Thanks
    0
    Thanked 0 Times in 0 Posts
    This code could be quickly modified to suit your situation.


    Dim RemoveDB As Database
    Dim strTempTbl As String
    Dim TempTableName As String

    Dim I As Integer

    Set RemoveDB = DBEngine.Workspaces(0).Databases(0)
    TempTableName = "tblTemp" & CurrentUser()

    For I = 0 To RemoveDB.TableDefs.Count - 2
    strTempTbl = RemoveDB.TableDefs(I).Name
    '-----Debug.Print strTempTbl
    '-----MsgBox "Table Name(" & i & ") = " & strtblname

    If strTempTbl Like TempTableName Then
    RemoveDB.TableDefs.Delete strTempTbl

    End If

    Next I


    Hope this helps.
    Richard

  15. #15
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    USA
    Posts
    386
    Thanks
    0
    Thanked 0 Times in 0 Posts
    This code could be quickly modified to suit your situation.


    Dim RemoveDB As Database
    Dim strTempTbl As String
    Dim TempTableName As String

    Dim I As Integer

    Set RemoveDB = DBEngine.Workspaces(0).Databases(0)
    TempTableName = "tblTemp" & CurrentUser()

    For I = 0 To RemoveDB.TableDefs.Count - 2
    strTempTbl = RemoveDB.TableDefs(I).Name
    '-----Debug.Print strTempTbl
    '-----MsgBox "Table Name(" & i & ") = " & strtblname

    If strTempTbl Like TempTableName Then
    RemoveDB.TableDefs.Delete strTempTbl

    End If

    Next I


    Hope this helps.
    Richard

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •