Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old June 27th, 2008, 08:26 PM
susan
Guest
 
Posts: n/a
Default display location of linked db

Hi,

In my application I want the location of my application-database as well as
the location of my data-database to be displayed.

I retrieve the name of the application by:
ApplName = DBEngine(0)(0).Name

In the application I use links to the tables of my data-database.
How can I retrieve the location / name of the data-database?

DataName = <link to data-database>

Thanks,

susan


  #2  
Old June 27th, 2008, 08:26 PM
Stuart McCall
Guest
 
Posts: n/a
Default Re: display location of linked db

"susan" <vdb@hotmail.comwrote in message
news:aed08$48450dcf$524b37b6$25507@cache3.tilbu1.n b.home.nl...
Quote:
Hi,
>
In my application I want the location of my application-database as well
as the location of my data-database to be displayed.
>
I retrieve the name of the application by:
ApplName = DBEngine(0)(0).Name
>
In the application I use links to the tables of my data-database.
How can I retrieve the location / name of the data-database?
>
DataName = <link to data-database>
>
Thanks,
>
susan
Grab this procedure (you'll find instructions how to do this if you're not
sure) :

http://www.smccall.demon.co.uk/DAO.htm#ConnectPart

Then use it like this:

DataName = ConnectPart("DATABASE")



  #3  
Old June 27th, 2008, 08:26 PM
susan
Guest
 
Posts: n/a
Default Re: display location of linked db


"Stuart McCall" <smccall@myunrealbox.comschreef in bericht
news:g233k5$kri$1$8300dec7@news.demon.co.uk...
Quote:
"susan" <vdb@hotmail.comwrote in message
news:aed08$48450dcf$524b37b6$25507@cache3.tilbu1.n b.home.nl...
Quote:
>Hi,
>>
>In my application I want the location of my application-database as well
>as the location of my data-database to be displayed.
>>
>I retrieve the name of the application by:
>ApplName = DBEngine(0)(0).Name
>>
>In the application I use links to the tables of my data-database.
>How can I retrieve the location / name of the data-database?
>>
>DataName = <link to data-database>
>>
>Thanks,
>>
>susan
>
Grab this procedure (you'll find instructions how to do this if you're not
sure) :
>
http://www.smccall.demon.co.uk/DAO.htm#ConnectPart
>
Then use it like this:
>
DataName = ConnectPart("DATABASE")
>
>
>
Too bad. Dead link...


  #4  
Old June 27th, 2008, 08:26 PM
Stuart McCall
Guest
 
Posts: n/a
Default Re: display location of linked db

"susan" <vdb@hotmail.comwrote in message
news:47a13$4845267a$524b37b6$19963@cache1.tilbu1.n b.home.nl...
Quote:
>
"Stuart McCall" <smccall@myunrealbox.comschreef in bericht
news:g233k5$kri$1$8300dec7@news.demon.co.uk...
Quote:
>"susan" <vdb@hotmail.comwrote in message
>news:aed08$48450dcf$524b37b6$25507@cache3.tilbu1. nb.home.nl...
Quote:
>>Hi,
>>>
>>In my application I want the location of my application-database as well
>>as the location of my data-database to be displayed.
>>>
>>I retrieve the name of the application by:
>>ApplName = DBEngine(0)(0).Name
>>>
>>In the application I use links to the tables of my data-database.
>>How can I retrieve the location / name of the data-database?
>>>
>>DataName = <link to data-database>
>>>
>>Thanks,
>>>
>>susan
>>
>Grab this procedure (you'll find instructions how to do this if you're
>not sure) :
>>
>http://www.smccall.demon.co.uk/DAO.htm#ConnectPart
>>
>Then use it like this:
>>
>DataName = ConnectPart("DATABASE")
>>
>>
>>
Too bad. Dead link...
It seems my ISP is having problems (I can't access my site either). Please
try again sometime later. They usually fix problems fairly quickly - I'd say
give it a couple of hours.


  #5  
Old June 27th, 2008, 08:26 PM
Wayne Gillespie
Guest
 
Posts: n/a
Default Re: display location of linked db

On Tue, 3 Jun 2008 11:24:42 +0200, "susan" <vdb@hotmail.comwrote:
Quote:
>Hi,
>
>In my application I want the location of my application-database as well as
>the location of my data-database to be displayed.
>
>I retrieve the name of the application by:
>ApplName = DBEngine(0)(0).Name
>
>In the application I use links to the tables of my data-database.
>How can I retrieve the location / name of the data-database?
>
>DataName = <link to data-database>
>
>Thanks,
>
>susan
>
Assuming the table is a JET table (NOT ODBC) then passing the table name to this
function will return the path of the database containing the linked table.

Function fGetLinkPath(strTableName As String) As String
Dim strConnect As String

strConnect = CurrentDb.TableDefs(strTableName).Connect
fGetLinkPath = Right(strConnect, Len(strConnect) - 10)

End Function


Wayne Gillespie
Gosford NSW Australia
  #6  
Old June 27th, 2008, 08:26 PM
Larry Linson
Guest
 
Posts: n/a
Default Re: display location of linked db

"susan" <vdb@hotmail.comwrote in message
news:aed08$48450dcf$524b37b6$25507@cache3.tilbu1.n b.home.nl...
Quote:
Hi,
>
In my application I want the location of my application-database as well
as the location of my data-database to be displayed.
>
I retrieve the name of the application by:
ApplName = DBEngine(0)(0).Name
>
In the application I use links to the tables of my data-database.
How can I retrieve the location / name of the data-database?
>
DataName = <link to data-database>
In the Immediate Window, where "tblSampleForLink" is the name of a linked
table, the following returns the Connect property, from which you can
extract the path and name of a linked Access database.

(Caveat 1: the Connect property will differ depending on the type of
database in which the linked table resides. A linked table in SQL Server or
Oracle will have a different structure for the Connect property's string
value, for example.
Caveat 2: It is possible to link to tables in more than one database, and
if that is the case in your application, you will need to choose a table in
each, if you want to display each linked DB.)

? CurrentDB().TableDefs("tblSampleForLink").Connect
;DATABASE=C:\data\Access\Access2003\A2003TestBackE nd.mdb

My sample code is from a database created in Access 2003, but should be the
same for any previous 32-bit version of Access.

Larry Linson
Microsoft Office Access MVP


 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles