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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access connection prompting for a password. Error 70.

Status
Not open for further replies.

2rowdy

Technical User
Nov 15, 2016
4
US
I have an email module in Access 2016 connecting to excel 2016 spreadsheet. The code calls Outlook. When I get to the following code block, I am prompted for a password:


The code sticks at FileCopy xlFile, sendFile

FileCopy xlFile, sendFile
Set xlapp = excel.Application
Set xlBk = xlapp.Workbooks.Open(sendFile)
xlBk.RefreshAll ' refreshall was not in the library
On Error Resume Next
For Each cn In xlBk.Connections
cn.Delete

17 hours ago
The error where the code stops is Error 70, permission denied.

Thank you.

2Rowdy
 
I am prompted for a password. I know of no write protection, nor do I know a password. I removed all passwords from my windows user account, I am still getting the error. I can modify the files, both access and excel files. I can save them. The password must have something to do with the connection, but I have no idea what.

Neither the Access file or the Excel file are protected in anyway. I have reviewed the Trust Center and there is no protection on either of these files.

Why am I being prompted for a password for this file, or the connection to the file?

 
You may have password in linked data in excel file, try it by opening excel file and refreshing links.

combo
 
I found an loop error in a block of code and corrected it. The procedure no longer stops at FileCopy xlFile, SendFile, but I am still getting the error requesting the password for the admin account. I have removed all passwords from my local admin account, I have closed down my virus protection and firewall. I have checked both excel and access files for password protection (there is none in either program), I have checked the application's Trust Center.

The code runs but I am prompted for a password and after the email sent messagebox, I get a message box that says

Code:
"5: invalid procedure call or argument."

I tried making a new connection using the Data Connecton Wizard in Excel. Under Data Link Properties, I am prompted for Data Source. I am not sure what it is asking for so I put the path to my access file in that input box. When i test the connection, I get the error
Code:
"Test connection failed because of an error in initalizing provider (provider is "Microsoft Office 16.0 Access Database Engine OLE DB Provider").  "The database has been place in a state by "Admin" on machine 'My machine name' that prevents it from being opened or locked."
I had selected "Share Deny None' on the Advanced tab for Access Permissions.
 
Combo:

I have to thank you for your attempt to resolve my problem. Someone suggested my access file was corrupted.
I created a new access file and imported all my objects into the new file... and the password issue went away.

THANK YOU!

2Rowdy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top