Welcome to SPN

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

Sign Up Now!
  1.   Become a Supporter    ::   Make a Contribution   
    Target (Recurring Monthly): $200 :: Achieved: $98

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"
    >>
    >>
    >>
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page