Determine the drive letter of BE database...

A

ambushsinger

I have an mde that accesses a back end mdb. Using VBA...how can I determine
the network drive letter of that back end database?
 
P

PieterLinden via AccessMonster.com

ambushsinger said:
I have an mde that accesses a back end mdb. Using VBA...how can I determine
the network drive letter of that back end database?

depends on how it's mapped.... you should be able to take just the leftmost
character of the Connect property of an attached tabledef

Left$(DBEngine(0)(0).Tabledefs("tdfAttached").Connect,1)

If you're getting the UNC path, then you'd have to dig around on
www.vbnet.mvps.org and find the function to convert the returned path to a
UNC path.
 
D

Dirk Goldgar

PieterLinden via AccessMonster.com said:
depends on how it's mapped.... you should be able to take just the
leftmost
character of the Connect property of an attached tabledef

Left$(DBEngine(0)(0).Tabledefs("tdfAttached").Connect,1)

It won't be the 1st character of the Connect property, because for an Access
back-end that will begin with ";DATABASE=". Use

Mid$(DBEngine(0)(0).Tabledefs("tdfAttached").Connect, 11, 1)
 

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