Page 1 of 3 123 LastLast
Results 1 to 15 of 41
  1. #1
    2 Star Lounger
    Join Date
    Jan 2012
    Posts
    155
    Thanks
    118
    Thanked 0 Times in 0 Posts

    Way to import external data automatically?

    friends,

    I have a database where I import data from another database as follows:

    Care tables that seat on the "External Data". Once you have a code for the event by clicking a button on a form, that takes each
    record and puts in another table. At the end of the code imported table is deleted. Works perfectly, but I wonder if one way to accomplish this automatically.

    For example, a button, which, via macro or vba, I say import external data, run a query to include external data in this table to an existing table in the database table and then delete this "temporary" my BD?

    Thank you.

  2. #2
    Administrator
    Join Date
    Jun 2010
    Location
    Portugal
    Posts
    10,285
    Thanks
    130
    Thanked 1,153 Times in 1,062 Posts
    Hi Fabio,

    Is the external database an Access database, as well?

  3. The Following User Says Thank You to ruirib For This Useful Post:

    fabiobarreto10 (2012-12-15)

  4. #3
    2 Star Lounger
    Join Date
    Jan 2012
    Posts
    155
    Thanks
    118
    Thanked 0 Times in 0 Posts
    Hi Rui,

    Yes, Access too.

  5. #4
    Administrator
    Join Date
    Jun 2010
    Location
    Portugal
    Posts
    10,285
    Thanks
    130
    Thanked 1,153 Times in 1,062 Posts
    I would link the external tables that you need to have access to. Once you do that, you can treat them as local tables, which means you can run queries to get data from then into your own "native tables", as you need. Now, I know you have used linked tables before, so let me ask you if there is any reason for you not to have considered it now, or have you considered it?

  6. The Following User Says Thank You to ruirib For This Useful Post:

    fabiobarreto10 (2012-12-15)

  7. #5
    2 Star Lounger
    Join Date
    Jan 2012
    Posts
    155
    Thanks
    118
    Thanked 0 Times in 0 Posts
    Rui, now put the linked tables that simply automated the process, but after I break the bank is experiencing an error.

    How I'm doing:

    I split the main bank (fe: Form - b: database_dir). Encrypt be: database_dir.

    Then I created a link to a table from another database (name: Bank), created this bond through fe: Form.

    But now when I transfer the records I get the following message:

    Run-time Error '3031 ':

    Invalid password.

    Where am I going wrong?

    Thank you.

  8. #6
    Administrator
    Join Date
    Jun 2010
    Location
    Portugal
    Posts
    10,285
    Thanks
    130
    Thanked 1,153 Times in 1,062 Posts
    How are you importing? Running some code or similar?

  9. The Following User Says Thank You to ruirib For This Useful Post:

    fabiobarreto10 (2012-12-15)

  10. #7
    2 Star Lounger
    Join Date
    Jan 2012
    Posts
    155
    Thanks
    118
    Thanked 0 Times in 0 Posts
    At the event by clicking a button on the form has a code that gets the records from the linked table (External Database) and placed in the linked table (Database "internal"). After I took the encryption of the database has not occurred over the error. My problem is to encrypt the database.But I could not identify the reason.

  11. #8
    Administrator
    Join Date
    Jun 2010
    Location
    Portugal
    Posts
    10,285
    Thanks
    130
    Thanked 1,153 Times in 1,062 Posts
    By encryption you mean setting a password for the database where you are getting the data?

  12. The Following User Says Thank You to ruirib For This Useful Post:

    fabiobarreto10 (2012-12-15)

  13. #9
    2 Star Lounger
    Join Date
    Jan 2012
    Posts
    155
    Thanks
    118
    Thanked 0 Times in 0 Posts
    yes, a password for the database where the database tables are divided (bd_be)

  14. #10
    Administrator
    Join Date
    Jun 2010
    Location
    Portugal
    Posts
    10,285
    Thanks
    130
    Thanked 1,153 Times in 1,062 Posts
    When you link the tables, isn't Access asking you to provide the password? If it does, it should save it automatically.

  15. The Following User Says Thank You to ruirib For This Useful Post:

    fabiobarreto10 (2012-12-15)

  16. #11
    2 Star Lounger
    Join Date
    Jan 2012
    Posts
    155
    Thanks
    118
    Thanked 0 Times in 0 Posts
    Rui, for clarity I put the databases on gmail (login: windowssecretslounge@gmail.com password: windowssecretslounge).

    See the path of linked tables need to be changed to the path where you save (Formulario_fe). In the bank "Formulario_Fe" has a form
    the name "Formulario_Transfere". By clicking on the code transfers table records linked bank named "Banco" for the table linked bank
    named "BAnco de dados". After putting a few records in the form "Tabela_Saida_Areia3" bank "Banco". When encryption is placed on the bench
    data (file with the name: Banco de dados), by clicking the transfer of records, shows an error: Incorrect password ...

  17. #12
    Administrator
    Join Date
    Jun 2010
    Location
    Portugal
    Posts
    10,285
    Thanks
    130
    Thanked 1,153 Times in 1,062 Posts
    Fabio, I had no problems getting it to work. What you need to do is delete the linked table, open the database you want to protect with the password and add the password, then close the that database. Open the Formulario_be database and link the table again. You will then be able to run your form.

    I tested this procedure and it worked flawlessly.

  18. The Following User Says Thank You to ruirib For This Useful Post:

    fabiobarreto10 (2012-12-15)

  19. #13
    2 Star Lounger
    Join Date
    Jan 2012
    Posts
    155
    Thanks
    118
    Thanked 0 Times in 0 Posts
    Rui, perfect!!

    Just to finish this post I would like to ask for your help with the following:

    In the database Formulario_fe I have a code in the event to open the form with the name "Formulario_Inicial."

    He notes in the linked table if there is any record, if so displays a message saying to transfer the records,
    and opens the form of transfer. If not, no action, the initial form opens normally.

    The bank is in an external USB drive, (the bank named "Banco") if I take the USB drive, to open the bank initial form "formulario_fe", I get an error message.

    How do I not get this message, ie what code I use to check if the linked table is available?

    Thank you.

  20. #14
    Administrator
    Join Date
    Jun 2010
    Location
    Portugal
    Posts
    10,285
    Thanks
    130
    Thanked 1,153 Times in 1,062 Posts
    Fabio,

    Is the database expected to be at a given path, which is always the same, or would you like to test the external database existence regardless of the path?

  21. The Following User Says Thank You to ruirib For This Useful Post:

    fabiobarreto10 (2012-12-15)

  22. #15
    2 Star Lounger
    Join Date
    Jan 2012
    Posts
    155
    Thanks
    118
    Thanked 0 Times in 0 Posts
    Rui,

    The path will always be the same. But if it is possible and not too complex, it might be interesting to any path. (in the thumb drive. Right?)

Page 1 of 3 123 LastLast

Posting Permissions

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