Link to home
Start Free TrialLog in
Avatar of ccapital
ccapital

asked on

Hyperlink issue on an Access 2007 form. Possible security restriction.

I appear to have an issue which might relate to security when trying to click on a control on an Access form which opens a web address.

I am runninng Access 2007 and have a form which allows me to browse through member's profiles. These are members of my website.

One of the fields in the database if the User's ID (uid). I can access their online details by using the URL "http://www.mydomain.com/user/uid".

I have added a button to my form with the label 'View Profile' and the following code attached the the click event:

Dim strLink As String
strLink = "http://www.mydomain.com/user/" & uid
Application.FollowHyperlink strLink

Now, I do need to be logged into the site as administrator to be able to access those pages. I have a currently logged in session in my browser and if I close/re-open my browser I am still logged in so it is retaining a cookie for authentication etc.

I click on the button in Access and get the following error:

Run-time error '8':
Cannot download the information you requested.

I performed aditional tests using other URLs on the site and managed to find a pattern.

I have a page (mydomain.com/node/5) which is accessible by members of the public. Another URL (mydomain.com/node/9) which is not, you need to be logged in to access it.

hard coding the first URL behind the button results in a perfect link which works fine. The second URL provides the same failure message EVEN THOUGH my browser is logged in and DOES have access to that page.

So, it appears Access itself is somehow checking for access to the page prior to communicating with the browser???

If I am unable to get this working is there an alternative way that I can feed a URL to a browser??

Many thanks for any help
Avatar of techhealth
techhealth
Flag of United States of America image

Could a hyperlink Image or Button suit your need?  Those would direct you to your link in browser in a straightforward fashion.  I suspect Application.FollowHyperlink has some internal step that have problem with authenticated page.
Avatar of ccapital
ccapital

ASKER

Thanks a million,

To be honest I really couldn't care less what the control is as long as it is something I can click on to access a user profile.

I will go look to see if this works and report back...

No luck...

Different message but same result, it doesn't work. Error message is now:

Unable to open http://www.mydomain.com/node/9. Cannot download the information you requested.

This was based upon my making the Hyperlink Address property of a button "http://www.mydomain/node/9".

Curiosly if I instead make the property the URL without the http://prefix I first get a new dialog box with the title "Microsoft Office Access Security Notice" and the message:

A potential security concern has been identified.

This location may be unsafe

www.mydomain/node/9

Hyperlinks can be harmful to your computer and data. To protect your computer, click only those hyperlinks from trusted sources.

Do you want to continue?

When I then click on Yes I get the following error message, different from the one above.

Unable to open http://www.mydomain.com/node/9. Cannot open the specificed file.
ASKER CERTIFIED SOLUTION
Avatar of ccapital
ccapital

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I am accepting my own comment. I hope this is the right thing to do when I find my own solution...
Switching the authentication setting to "Anonymous logon" might help the Access FollowHyperLink - the default is "automatic only when intranet".  In any case, you got it work with ShellExecute already.  Thanks for sharing.
auth.png
Thanks, I tried that just now but no luck. Again, just reporting back to help those in the future that might read this.

The issue pertains to FF and IE so I suspect Access is the common denominator here causing it.

It seems surprising to me that noone has reported this issues before, c'est la vie.

Thanks again,
Paul