dbTalk Databases Forums  

Function to Return the Location of the Backend

comp.databases.ms-access comp.databases.ms-access


Discuss Function to Return the Location of the Backend in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Barry Edmund Wright
 
Posts: n/a

Default Function to Return the Location of the Backend - 08-13-2010 , 09:15 AM






Hi All,

My tables are linked to a Backend called DMS.mdb in:
S:\General\Databases\DMS\DMS.mdb

Could someone give me a function which would return the full path to
the backend, including of not including the db name:

msgbox "Location of Backend: " & FunctionName

Thanks,
Barry

Reply With Quote
  #2  
Old   
Salad
 
Posts: n/a

Default Re: Function to Return the Location of the Backend - 08-13-2010 , 09:38 AM






Barry Edmund Wright wrote:

Quote:
Hi All,

My tables are linked to a Backend called DMS.mdb in:
S:\General\Databases\DMS\DMS.mdb

Could someone give me a function which would return the full path to
the backend, including of not including the db name:

msgbox "Location of Backend: " & FunctionName

Thanks,
Barry
This returns the full path of a linked table else null.

Public Function GetBEName(strTable) As Variant
GetBEName = DLookup("Database", "MSysObjects", "Name='" & strTable &
"' And Type=6")
End Function

msgbox GetBEName("YourTableName")

Reply With Quote
  #3  
Old   
Barry Edmund Wright
 
Posts: n/a

Default Re: Function to Return the Location of the Backend - 08-13-2010 , 10:48 AM



Thanks Salad, exactly what I wanted.
Cheers,
Barry

On Aug 13, 10:38*am, Salad <sa... (AT) oilandvinegar (DOT) com> wrote:
Quote:
Barry Edmund Wright wrote:
Hi All,

My tables are linked to a Backend called DMS.mdb in:
S:\General\Databases\DMS\DMS.mdb

Could someone give me a function which would return the full path to
the backend, including of not including the db name:

msgbox "Location of Backend: " & FunctionName

Thanks,
Barry

This returns the full path of a linked table else null.

Public Function GetBEName(strTable) As Variant
* * GetBEName = DLookup("Database", "MSysObjects", "Name='" & strTable &
"' And Type=6")
End Function

msgbox GetBEName("YourTableName")

Reply With Quote
  #4  
Old   
David W. Fenton
 
Posts: n/a

Default Re: Function to Return the Location of the Backend - 08-13-2010 , 10:20 PM



Salad <salad (AT) oilandvinegar (DOT) com> wrote in
news:uLmdndLzfoNgxfjRnZ2dnUVZ_t2dnZ2d (AT) earthlink (DOT) com:

Quote:
Barry Edmund Wright wrote:

My tables are linked to a Backend called DMS.mdb in:
S:\General\Databases\DMS\DMS.mdb

Could someone give me a function which would return the full path
to the backend, including of not including the db name:

msgbox "Location of Backend: " & FunctionName

Thanks,
Barry

This returns the full path of a linked table else null.

Public Function GetBEName(strTable) As Variant
GetBEName = DLookup("Database", "MSysObjects", "Name='" &
strTable &
"' And Type=6")
End Function

msgbox GetBEName("YourTableName")
Heavens, I always use:

Mid(CurrentDB.TableDefs(strTable).Connect, 11)

--
David W. Fenton http://www.dfenton.com/
contact via website only http://www.dfenton.com/DFA/

Reply With Quote
  #5  
Old   
Salad
 
Posts: n/a

Default Re: Function to Return the Location of the Backend - 08-13-2010 , 10:56 PM



David W. Fenton wrote:

Quote:
Salad <salad (AT) oilandvinegar (DOT) com> wrote in
news:uLmdndLzfoNgxfjRnZ2dnUVZ_t2dnZ2d (AT) earthlink (DOT) com:


Barry Edmund Wright wrote:


My tables are linked to a Backend called DMS.mdb in:
S:\General\Databases\DMS\DMS.mdb

Could someone give me a function which would return the full path
to the backend, including of not including the db name:

msgbox "Location of Backend: " & FunctionName

Thanks,
Barry

This returns the full path of a linked table else null.

Public Function GetBEName(strTable) As Variant
GetBEName = DLookup("Database", "MSysObjects", "Name='" &
strTable &
"' And Type=6")
End Function

msgbox GetBEName("YourTableName")


Heavens, I always use:

Mid(CurrentDB.TableDefs(strTable).Connect, 11)

There's more than one way to skin a cat.

Reply With Quote
  #6  
Old   
David W. Fenton
 
Posts: n/a

Default Re: Function to Return the Location of the Backend - 08-14-2010 , 02:23 PM



Salad <salad (AT) oilandvinegar (DOT) com> wrote in
news:dsidnd3SS5BjjvvRnZ2dnUVZ_s2dnZ2d (AT) earthlink (DOT) com:

Quote:
David W. Fenton wrote:

Salad <salad (AT) oilandvinegar (DOT) com> wrote in
news:uLmdndLzfoNgxfjRnZ2dnUVZ_t2dnZ2d (AT) earthlink (DOT) com:

This returns the full path of a linked table else null.

Public Function GetBEName(strTable) As Variant
GetBEName = DLookup("Database", "MSysObjects", "Name='" &
strTable &
"' And Type=6")
End Function

msgbox GetBEName("YourTableName")

Heavens, I always use:

Mid(CurrentDB.TableDefs(strTable).Connect, 11)

There's more than one way to skin a cat.
What I meant was that I don't even have a function for this -- I
just type in the Mid() statement as above.

Actually, I do have a function for it, but don't use it any more.

I do have something of a love affair with Mid() -- I use it all over
the place for all sorts of things, particularly capitalizing on Null
concatenation with the + operator.

--
David W. Fenton http://www.dfenton.com/
contact via website only http://www.dfenton.com/DFA/

Reply With Quote
  #7  
Old   
Chuck Grimsby
 
Posts: n/a

Default Re: Function to Return the Location of the Backend - 08-15-2010 , 12:43 PM



On Aug 14, 2:23*pm, "David W. Fenton" <NoEm... (AT) SeeSignature (DOT) invalid>
wrote:
Quote:
Salad <sa... (AT) oilandvinegar (DOT) com> wrote innews:dsidnd3SS5BjjvvRnZ2dnUVZ_s2dnZ2d (AT) earthlink (DOT) com:





David W. Fenton wrote:

Salad <sa... (AT) oilandvinegar (DOT) com> wrote in
news:uLmdndLzfoNgxfjRnZ2dnUVZ_t2dnZ2d (AT) earthlink (DOT) com:
This returns the full path of a linked table else null.

Public Function GetBEName(strTable) As Variant
* *GetBEName = DLookup("Database", "MSysObjects", "Name='" &
* *strTable &
"' And Type=6")
End Function

msgbox GetBEName("YourTableName")

Heavens, I always use:

* Mid(CurrentDB.TableDefs(strTable).Connect, 11)

There's more than one way to skin a cat.

What I meant was that I don't even have a function for this -- I
just type in the Mid() statement as above.

Actually, I do have a function for it, but don't use it any more.

I do have something of a love affair with Mid() -- I use it all over
the place for all sorts of things, particularly capitalizing on Null
concatenation with the + operator.

--
David W. Fenton * * * * * * * * *http://www.dfenton.com/
contact via website only * *http://www.dfenton.com/DFA/
There's always all the shlwapi DLL functions. I tend to use those
*alot* for anything to do with path and file name manipulation.

Reply With Quote
  #8  
Old   
a a r o n _ k e m p f
 
Posts: n/a

Default Re: Function to Return the Location of the Backend - 08-17-2010 , 01:54 PM



Wow.. I got tired of using jet backends a decade ago.. and decided
that moving to SQL Server gives better performance, scalability,
stability _AND_ it's easier to program against.





On Aug 13, 7:15*am, Barry Edmund Wright
<barry.edmund.wri... (AT) witstoronto (DOT) ca> wrote:
Quote:
Hi All,

My tables are linked to a Backend called DMS.mdb in:
S:\General\Databases\DMS\DMS.mdb

Could someone give me a function which would return the full path to
the backend, including of not including the db name:

msgbox "Location of Backend: " & FunctionName

Thanks,
Barry

Reply With Quote
Reply




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 On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.