Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CopyObject: Macro action prompts for password

Status
Not open for further replies.

djmc

Programmer
Jun 12, 2002
179
CA
I am using the CopyObject to export some sections of a table to another table in a separate secured database (with database password). I would like to know how I can eliminate the problem with prompting for a password everytime it executes the CopyObject action (i.e Is there a way to automate the password entry via some parameter/method)
 
Can't think of other then SendKeys action.
That code below will prevent message from popping up and just replace file without trouble.
So, this function basically "punches" ENTER for you.
I think you need SendKeys to push some button for you too may be ...
SendKeys TableName & "{ENTER}", False 'will stop "enter SaveAs Name of" and message "File already Exists" and replace existing file.

At least I've tried...
TIA
 
I tried SendKeys within the macro after the CopyObject action so that it would send the password when it prompts for the database password after the CopyObject command has been executed. It works on my computer but for some reason it does not work on my co-worker's computer as it still prompted for the password. Could timing (of sendkey) be a problem here?
 
Have you closed database on your PC before you tried co-worker's one ?
Anyway if it works on your PC - it works !
So, get comfortable and tell your co-worker to reboot and compact and repair and compact again.

Luck
TIA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top