Absolute location of an Access Database.

C

Chrisso

Hello

I need to get the absolute location of an Access Database.

At the moment I can call CurrentDB.Name but this gives me the mapped
drive name:

W:\Public\CODAC

Where I really need the actual server address:

\\Brd-dc-01\Dept\Public\CODAC

Can I get this from Access?

Chrisso
 
R

Rob Parker

The code at http://www.mvps.org/access/api/api0003.htm will let you convert
CurrentDB.Name to a UNC string.

Using that code, here's a function which I use to convert a mapped drice
path to a UNC path.

'---------------------------------------------------------------------------------------
' Procedure : UNCFolder
' Last Edit : 03 Apr 2006
' Author : Rob Parker
' Purpose : Convert a network path to a UNC path
'---------------------------------------------------------------------------------------
'
Public Function UNCFolder(strFolder As String) As String
Dim strDrive As String

strDrive = Left(strFolder, 3)
If fDriveType(strDrive) = "Network drive" Then
UNCFolder = fGetUNCPath(Left$(strDrive, Len(strDrive) - 1))
'fGetUNCPath returns a null-terminated string - need to parse to null
before concatenating rest of folder string
UNCFolder = Mid$(UNCFolder, 1, InStr(UNCFolder, vbNullChar) - 1)
UNCFolder = UNCFolder & Mid$(strFolder, 3)
Else
UNCFolder = strFolder
End If
End Function

HTH,

Rob
 
A

a a r o n . k e m p f

wow.. good stuff.

Of course-- you don't really need to use that linked tables BS--
Linked tables are a complete waste of time.

you really shoud be using SQL Server-- then you wouldn't worry about
linked tables.

-Aaron
 
R

Rob Parker

Aaron, please go away and stop wasting time and space here with your SQL/ADP
campaign, which for most of the people seeking advice here is absolutely
inappropriate.

Rob

message
wow.. good stuff.

Of course-- you don't really need to use that linked tables BS--
Linked tables are a complete waste of time.

you really shoud be using SQL Server-- then you wouldn't worry about
linked tables.

-Aaron
 
A

a a r o n . k e m p f

it's a free country ain't it?

This is _MY_ newsgroup-- not yours.

It is no longer reccomended that you kids use Linked Table BS. It has
not been reccomended like this for a decade.

You can go and take your arguments elsewhere.

This newsgroup is the 'Default Newsgroup for MS Access' and because
'ADP is the most prevalent database format ever since 2000' then _YOU_
can go elsewhere.

-Aaron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top