Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2003
    Posts
    25

    Unanswered: Automating an import file

    I need help automating the task of importing files from our ftp folder into access. The number of files in the ftp folder differs depending on the number of rail cars we are currently tracking. I have enough programming written that flawlessly launches the appropriate database file at 5:00 a.m. The problem I cannot seem to get around is typing in the administrative password in the log on box in order to gain access to the database. I either need a way around the security or a way to gain access to the control, so the password can be entered. Once the password is entered, a macro automatically imports the files from the ftp folder and deletes the files in the ftp folder. Any suggestions would be most helpful.
    Last edited by tibbsy; 07-23-03 at 16:31.

  2. #2
    Join Date
    May 2002
    Location
    London
    Posts
    87
    Would an alternative be to keep the database running overnight and use a timer event to start the import routine?

    Create a form and set it up with a timer interval of say 900000 and an OnTimer to check if the time was after 5am.

  3. #3
    Join Date
    Jul 2003
    Location
    Michigan
    Posts
    1,941
    Not sure of the method you're using to launch the DB, but if you're
    using a .bat file, you need to add /user and /pwd arguments to the line
    that launches the app.

    "C:\YourPath\Yourdatabase.mdb" /user "YourName" /pwd "Yourpassword"

    See "Startup Command-Line options" in the help files for more info.
    Inspiration Through Fermentation

  4. #4
    Join Date
    Jul 2003
    Posts
    25
    Thank you for the advice. I won't be able to implent it for a few days, but I'm sure it will work. If it doesn't, you gave me a few more ideas to try.

  5. #5
    Join Date
    Jul 2003
    Posts
    38
    From within Access it seems useful to connect directly.

    Check the helpfile for docmd.TransferDatabase.
    this example creates a link to a database, and look, there is a field for pw ^^

    DoCmd.TransferDatabase acLink, "ODBC Database", _
    "ODBC;DSN=DataSource1;UID=User2;PWD=www;LANGUAGE=u s_english;" _
    & "DATABASE=pubs", acTable, "Authors", "dboAuthors"

    If you don't want to link and unlink the table, the OpenDatabase function also allows pw's...

Posting Permissions

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