Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Rename a Back End Table

Discussion in 'Information Technology' started by N. Cotton, Jul 28, 2006.

  1. N. Cotton

    N. Cotton
    Expand Collapse
    Guest

    I have a Front and back end Database and need to rename a table in the back
    and a field within that table. I do this as follows:

    Dim dbsUpdate As Database, wrkDefault As Workspace
    Dim tdfUpdate As TableDef

    Set wrkDefault = DBEngine.Workspaces(0)

    Set dbsUpdate = wrkDefault.OpenDatabase(strBackEnd, True, False, "MS
    Access;")
    dbsUpdate.TableDefs("tbltemptable1").Name = "tblControl"
    dbsUpdate.TableDefs("tblControl").Fields("Field1").Name = "PatchVersion"

    My question is how do I then rename the table in the front-end without
    breaking the link?

    Many thanks.
     
  2. Loading...

    Similar Threads Forum Date
    India Sikhs seek to rename Indian town of Boj Boj after Komagata Maru Breaking News Oct 3, 2010
    Should Sikhism101 be renamed Sikhism 420? Hard Talk Mar 30, 2009
    Sikh News Golden Temple renamed Breaking News Mar 4, 2005
    Sikh News Golden Temple renamed as Harimandar Sahib Breaking News Mar 4, 2005
    Sikh News Haroon Khalid: Divided Rivers Of Punjab And Their Legends Breaking News Oct 21, 2016

  3. Rick Wannall

    Rick Wannall
    Expand Collapse
    Guest

    When you rename the table in the back end, you've already broken the link.

    Your best bet, after renaming the table in the back end, is to delete the
    link in the front end and then use transferdatabase to re-link the table,
    using the new table name as the source and any name you like for the link
    name.

    Check out "DoCmd.TransferDatabase acLink"
     
  4. N. Cotton

    N. Cotton
    Expand Collapse
    Guest

    thanks for the reply, I decided in the end it was easier to create a new
    table in both and set the source for the front end to the table in the back
    end.

    "Rick Wannall" wrote:

    > When you rename the table in the back end, you've already broken the link.
    >
    > Your best bet, after renaming the table in the back end, is to delete the
    > link in the front end and then use transferdatabase to re-link the table,
    > using the new table name as the source and any name you like for the link
    > name.
    >
    > Check out "DoCmd.TransferDatabase acLink"
    >
    >
    >
     
  5. Rick Wannall

    Rick Wannall
    Expand Collapse
    Guest

    That's pretty much what TransferDatabase acLink does.


    "N. Cotton" <NCotton@discussions.microsoft.com> wrote in message
    news:4843BF67-F3C0-4A07-A94A-006556CA7C9C@microsoft.com...
    > thanks for the reply, I decided in the end it was easier to create a new
    > table in both and set the source for the front end to the table in the
    > back
    > end.
    >
    > "Rick Wannall" wrote:
    >
    >> When you rename the table in the back end, you've already broken the
    >> link.
    >>
    >> Your best bet, after renaming the table in the back end, is to delete the
    >> link in the front end and then use transferdatabase to re-link the table,
    >> using the new table name as the source and any name you like for the link
    >> name.
    >>
    >> Check out "DoCmd.TransferDatabase acLink"
    >>
    >>
    >>
     

Share This Page