Results 1 to 10 of 10
  1. #1
    3 Star Lounger
    Join Date
    Apr 2003
    Location
    Calgary, Alberta
    Posts
    327
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Importing To Links (2000)

    I have my application with the forms/queryies/report/code in one app and the tables in another. Basically the tables are linked. In that client applcation, i am trying to import data from a csv file to the table that is link, but i cannot do that without overwriting the current data. Is there a way to import data to a link table? Would prefer to do it now from the menu, but make it a simple 1 button press, instead of using the wizard

    Thanks

  2. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Importing To Links (2000)

    You cannot import into a linked table because it firstly deletes the table then imports it, as far as i know.

    What i would do is import into a temporary table in the frontend then delete all records from the linked table then use an append query to copy from the temporary table to the linked table.

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Importing To Links (2000)

    You *can* import into a linked table, and deleting the records in the linked table is not a good idea - it's what Shimmer wanted to prevent!

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Importing To Links (2000)

    It doesn't matter whether the table is linked or not.

    When you import using File | Get External Data | Import..., you can specify that you want to import into a new table or into an existing table. You should specify that you want to import into an existing table, ans select the target table. If you do so, Access will try to append the imported records instead of overwriting the existing ones. You have to make sure in advance that there will be no key conflicts, of course.
    If you want to automate this, you should start the import process using the Wizard. But in the last step, click Advanced... instead of Finish, then click Save As... to save the import specification, say as MySpec. You can then cancel the actual import.
    The On Click event procedure for your button can execute a single line of code like this:

    DoCmd.TransferText acImportDelimited, "MySpec" ,"tblSomething", "C:TestTextFile.csv", False

    where MySpec is the name of the import specification, tblSomething is the name of the table, and C:TestTextFile.csv is the path and filename of the CSV file, and False indicates that the CSV file has no field names (if it does, specify True).

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Importing To Links (2000)

    BTW, the e-mail notifications of the replies to your question were returned as undeliverable because the e-mail address in your profile doesn't exist any more.
    All notifications have been turned off.
    Go to Edit profile and enter a valid e-mail address in the "Email Address (for our administrative use only...not visible to other users)" box and if you wish in the "Email address (displayed in profile)" box. You can turn on notifications again, then click Submit.

  6. #6
    3 Star Lounger
    Join Date
    Apr 2003
    Location
    Calgary, Alberta
    Posts
    327
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Importing To Links (2000)

    The table that I want to put the data in is a linked table. I do not see that linked table in the "existing table" list. I can import into a regular table. As for conflicts, on export, I have removed all the keys so the data can be updated

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Importing To Links (2000)

    I can't explain that. A table linked to another Access database should behave exactly the same as a table in the current database. When I run the Import Text wizard, both local and linked tables are shown in the dropdown list, without even an indication which is which. Have you made the linked tables hidden perhaps?

  8. #8
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Importing To Links (2000)

    Didn't realise that, sorry for the misinformation.

  9. #9
    3 Star Lounger
    Join Date
    Apr 2003
    Location
    Calgary, Alberta
    Posts
    327
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Importing To Links (2000)

    Nope they tables are not hidden. I did check the properties. I can import to a local table, then run a query to update a linked table. I would prefer to not have any local tables stored on the client. If you have other ideas, I am all ears

    Thanks

    Curtis

  10. #10
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Importing To Links (2000)

    No. I explained how it works in <post:=708,219>post 708,219</post:>.

Posting Permissions

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