Results 1 to 5 of 5

Thread: Renaming Linked Tables

  1. #1

    Thread Starter
    Addicted Member icemanmt78's Avatar
    Join Date
    May 2000
    Posts
    142

    Unhappy

    I have managed to create a linked table between two access databases using standard DAO techniques.

    I have a minor problem, I want to link a table from one database to another database that has a table of the same name. In which case i want to rename this link table to something else.

    Does anyone know how to have the option of naming a linked table, so i don't get any naming conflictions.

    Any Ideas!

    Mark

  2. #2
    Randalf the Red honeybee's Avatar
    Join Date
    Jun 2000
    Location
    off others' brains
    Posts
    4,345

    Question

    What are linked tables that you are talking about?

    And why do you need linked tables between two databases?
    I am not a complete idiot. Some parts are still missing.
    Check out the rtf-help tutorial
    General VB Faq Thread
    Change is the only constant thing. I have not changed my signature in a long while and now it has started to stink!
    Get more power for your floppy disks. ; View honeybee's Elite Club:
    Use meaningfull thread titles. And add "[Resolved]" in the thread title when you have got a satisfactory response.
    And if that response was mine, please think about giving me a rep. I like to collect them!

  3. #3

    Thread Starter
    Addicted Member icemanmt78's Avatar
    Join Date
    May 2000
    Posts
    142

    Angry Thanks

    That was help???

    I have been using dao as below

    Sub Main()

    Dim dbsSource As Database
    Dim dbsDest As Database
    Dim daotdflink As TableDef
    Dim sLinkHeader As String

    sLinkHeader = ";DATABASE="

    Set dbsDest = OpenDatabase("C:\windows\desktop\dest.mdb")
    MsgBox ("hello")
    Set daotdflink = dbsDest.CreateTableDef("traffic")
    daotdflink.Connect = sLinkHeader & "C:\windows\desktop\source.mdb"
    daotdflink.SourceTableName = "traffic"
    dbsDest.TableDefs.Append daotdflink


    End Sub

    To create a linked table. I want this table to be named differently in my destination database. The source database table i want to link to is called "traffic" but i want to call the linked table in my destination database LINK_traffic.

    Any ideas of how to choose a name for the linked table.


  4. #4
    Lively Member
    Join Date
    Oct 1999
    Posts
    90
    The CreateTableDef method controls the name of the new table you're making, so you can call it whatever you want, like this:

    Code:
    Set daotdflink = dbsDest.CreateTableDef("LINK_traffic")
    By the way, a lot of the answers to the questions you're asking in these forums can be easily found in the on-line documentation for VB or Access. You might want to read up on some of this stuff.

    And you're welcome for the table linking code. No need to say thanks or anything.

    -JoeyCode

  5. #5
    Randalf the Red honeybee's Avatar
    Join Date
    Jun 2000
    Location
    off others' brains
    Posts
    4,345

    Unhappy

    Oops!
    Icemanmt78, my reply was not meant to be of help to you, as I know almost nothing about the linked tables you discussed. I am sorry if I disappointed you.
    I am not a complete idiot. Some parts are still missing.
    Check out the rtf-help tutorial
    General VB Faq Thread
    Change is the only constant thing. I have not changed my signature in a long while and now it has started to stink!
    Get more power for your floppy disks. ; View honeybee's Elite Club:
    Use meaningfull thread titles. And add "[Resolved]" in the thread title when you have got a satisfactory response.
    And if that response was mine, please think about giving me a rep. I like to collect them!

Posting Permissions

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



Click Here to Expand Forum to Full Width