Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6898461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:17:58+00:00 2026-05-27T07:17:58+00:00

Summary: why might Docmd.Rename on a table result in tables that don’t change name

  • 0

Summary: why might Docmd.Rename on a table result in tables that don’t change name over a Link from another DB?

I’m trying to fix up an old database that needs TLC. Part of this is deleting lots of unused cruft, amongst which are some tables. The first part if a VBA procedure that calls DoCmd.Rename on these tables, renaming with DELETE_ prepended.

The “deletes” appear to work fine – but when I try to reference tables from another DB using the Linked Table manager, no renames have happened at all. If I go back and load that DB, the table names are changed.

Is it best to use TableDefs().Name to rename? Is that a better method? I’d assumed an “official” way like Rename would be better.

I’m using Access 2007 on Win7/64. The files are in MDB format.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T07:17:58+00:00Added an answer on May 27, 2026 at 7:17 am

    Do you wish to rename the tables in the linked database? If so, you can use OpenDatabase to reference the linked Access database. You might try something on the lines of:

    Dim dbLink As DAO.Database
    Dim dbCurr As DAO.Database
    Dim ws As DAO.Workspace
    Dim rst As DAO.Recordset
    Dim tdf As TableDef
    
    Set ws = DBEngine.Workspaces(0)
    Set dbCurr = CurrentDb
    
    For Each tdf In dbCurr.TableDefs
        sConn = tdf.Connect
        sSource = tdf.SourceTableName
        sName = tdf.Name
    
        If InStr(sConn, ";DATABASE=") > 0 Then
            strdb = Mid(sConn, InStr(sConn, ";DATABASE=") + 10)
    
            If InStr(sConn, "PWD") > 0 Then
                sPWD = Left(sConn, InStr(sConn, ";DATABASE="))
            Else
                sPWD = vbNullString
            End If
    
            If Dir(strdb) <> vbNullString Then
                Set dbLink = ws.OpenDatabase(strdb, False, False, sPWD)
                dbLink.TableDefs(sSource).Name = "DELETE_" & sSource
            End If
        End If
    
    Next
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Summary for those who might not want to read that much: How do I
Summary For some reason, git commands don't work the same when I am logged
Summary: I have passed the name of the id select tag into an Array.
Summary : is there a way to get the unique lines from a file
Summary Let's say I have two C# 4.0 classes, one inheriting from the other:
Summary We have an ASP.NET application that allows users to query a SQL Server
Summary Code sample: Class People { // private property. private $name; // other methods
I have 7 summary tables one for each day of the week. txn_summary_monday...txn_summary_tuesday and
Quick summary Pinging back to a webservice in ajax from the client keeps the
I want to extract the fstatistic value from summary(lm()). So far the only way

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.