A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

GetOpenFile() and UNC path



 
 
Thread Tools Display Modes
  #1  
Old April 14th, 2010, 02:29 PM posted to microsoft.public.access.forms
Nick Del Vecchio
external usenet poster
 
Posts: 19
Default GetOpenFile() and UNC path

I'm using the Me.textpic = GetOpenFile() code to search for a picture
in order to put the picture path on a form's text box.

This works fine except that I would like for it to display the UNC
path rather than the drive and directory path. Even if I browse to
the server share and pick the file using My Network places, it still
displays the drive and directory path instead of the UNC path.

Anyone know how I can get the GetOpenFile() to display the UNC path?

Thanks
  #2  
Old April 14th, 2010, 03:04 PM posted to microsoft.public.access.forms
Stefan Hoffmann
external usenet poster
 
Posts: 991
Default GetOpenFile() and UNC path

hi Nick,

On 14.04.2010 15:29, Nick Del Vecchio wrote:
Anyone know how I can get the GetOpenFile() to display the UNC path?


http://support.microsoft.com/kb/160529


mfG
-- stefan --
  #3  
Old April 14th, 2010, 03:15 PM posted to microsoft.public.access.forms
Dirk Goldgar
external usenet poster
 
Posts: 2,529
Default GetOpenFile() and UNC path

"Nick Del Vecchio" wrote in message
...
I'm using the Me.textpic = GetOpenFile() code to search for a picture
in order to put the picture path on a form's text box.

This works fine except that I would like for it to display the UNC
path rather than the drive and directory path. Even if I browse to
the server share and pick the file using My Network places, it still
displays the drive and directory path instead of the UNC path.

Anyone know how I can get the GetOpenFile() to display the UNC path?



There's a Windows API call to convert a mapped-drive path to a UNC path, but
I'm very surprised that you aren't getting the UNC path directly from
GetOpenFile if you browse to the network share rather than the mapped drive.
My own experience and everything I've ever seen posted says that you ought
to get the UNC path if you browse that way. What version of Windows and
Access are you using, and where did you get the GetOpenFile code you're
using?

--
Dirk Goldgar, MS Access MVP
Access tips: www.datagnostics.com/tips.html

(please reply to the newsgroup)

  #4  
Old April 17th, 2010, 12:39 PM posted to microsoft.public.access.forms
Nick Del Vecchio
external usenet poster
 
Posts: 19
Default GetOpenFile() and UNC path

Dirk,

I have the database on a computer with Windows XP SP3 using Access
2002. The database and image files are in that computer's local
folder which has been shared on the network.
When I browse to the image from that computer using My Network places,
Access changes the path to the local folder after I select the photo.
However, if I launch the same database from a networked computer that
uses Windows XP and Access 2003, the text box keeps the UNC path after
I select the photo.

If I use the local computer to access the same file with the UNC path
to the picture that was created by a networked computer - there is no
problem. The picture is displayed. This works well for all networked
computers as well.

However, if I use a networked computer to view the picture that was
inserted by the local computer, the path is to that computer's local
drive and I get an error that states that the path is not valid. For
some reason, the local computer with Access 2002 is changing the path
to it's local drive instead of maintaining the UNC path.

The code is very old. This is in the header of the basFileOpenDialog
module

'***************** Code Start **************
'This code was originally written by Ken Getz.
'It is not to be altered or distributed,
'except as part of an application.
'You are free to use it in any application,
'provided the copyright notice is left unchanged.
'
' Code courtesy of:
' Microsoft Access 95 How-To
' Ken Getz and Paul Litwin
' Waite Group Press, 1996


On Apr 14, 10:15*am, "Dirk Goldgar"
wrote:
"Nick Del Vecchio" wrote in ...

I'm using the Me.textpic = GetOpenFile() code to search for a picture
in order to put the picture path on a form's text box.


This works fine except that I would like for it to display the UNC
path rather than the drive and directory path. *Even if I browse to
the server share and pick the file using My Network places, it still
displays the drive and directory path instead of the UNC path.


Anyone know how I can get the GetOpenFile() to display the UNC path?


There's a Windows API call to convert a mapped-drive path to a UNC path, but
I'm very surprised that you aren't getting the UNC path directly from
GetOpenFile if you browse to the network share rather than the mapped drive.
My own experience and everything I've ever seen posted says that you ought
to get the UNC path if you browse that way. *What version of Windows and
Access are you using, and where did you get the GetOpenFile code you're
using?

--
Dirk Goldgar, MS Access MVP
Access tips:www.datagnostics.com/tips.html

(please reply to the newsgroup)


  #5  
Old April 19th, 2010, 07:50 PM posted to microsoft.public.access.forms
Dirk Goldgar
external usenet poster
 
Posts: 2,529
Default GetOpenFile() and UNC path

"Nick Del Vecchio" wrote in message
...

I have the database on a computer with Windows XP SP3 using Access 2002.
The database and image files are in that computer's local folder which has
been shared on the network. When I browse to the image from that computer
using My Network places, Access changes the path to the local folder after
I select the photo. However, if I launch the same database from a
networked computer that

uses Windows XP and Access 2003, the text box keeps the UNC path after I
select the photo.

If I use the local computer to access the same file with the UNC path to
the picture that was created by a networked computer - there is no
problem. The picture is displayed. This works well for all networked
computers as well.

However, if I use a networked computer to view the picture that was
inserted by the local computer, the path is to that computer's local drive
and I get an error that states that the path is not valid. For some
reason, the local computer with Access 2002 is changing the path to it's
local drive instead of maintaining the UNC path.


I can't seem to reproduce that on my PC running Vista, but I may not have
set up the exact same circumstances. I don't think it's Ken Getz's code, as
I'm using that code myself. I suspect it's an OS thing. I don't have any
good suggestion, though, except to either type in the UNC path directly (if
that works), or do it on a networked PC instead of the one where the file is
local.

--
Dirk Goldgar, MS Access MVP
Access tips: www.datagnostics.com/tips.html

(please reply to the newsgroup)

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:10 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.