Kamis, 05 April 2012

RE: [MS_AccessPros] Re: Display backend file path and file name

 

Art-

Yes, the database has to be split. Your original question:

"Is there a way to display the path and name of the backend file in a text box?"

The word "backend" implies it's split, and you're trying to display the location of the linked tables.

If you want the current location of the "code" database, use:

CurrentProject.FullName

By the way, you can also find the location of a linked table by looking at the Connect property of the TableDef object.

John Viescas, author
Microsoft Office Access 2010 Inside Out
Microsoft Office Access 2007 Inside Out
Building Microsoft Access Applications
Microsoft Office Access 2003 Inside Out
SQL Queries for Mere Mortals
http://www.viescas.com/
(Paris, France)

--------------------------

From: MS_Access_Professionals@yahoogroups.com [mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of Art Lorenzini
Sent: Thursday, April 05, 2012 2:34 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: Re: [MS_AccessPros] Re: Display backend file path and file name

Duane,

I tried:
SELECT Database
FROM MSysObjects
WHERE Name='tblUnit'

And it returned a blank record. Then I tried:

SELECT Database
FROM MSysObjects

It returned 746 rows which were all blank. The only thing that pops out at me is, does this only work with the database is split?

With warm regards,

Arthur Lorenzini
Sioux Falls, South Dakota

________________________________
From: Duane <duanehookom@hotmail.com>
To: MS_Access_Professionals@yahoogroups.com
Sent: Wednesday, April 4, 2012 9:46 PM
Subject: [MS_AccessPros] Re: Display backend file path and file name

Jim,
Create a query with this SQL:
SELECT Database
FROM MSysObjects
Where Name="NewHires";

What do you see?

Duane

--- In MS_Access_Professionals@yahoogroups.com, Jim Wagner <luvmymelody@...> wrote:
>
> Bill,
>
> I think I will need a dollar. I added it to my form load event added the text box with the exact name as txtFileLocation and I still see nothing in the text box.
>
> Me.txtFileLocation = DLookup("Database", "MSysObjects", "Name='NewHires'")
>
> Â
> Jim Wagner
> ________________________________
>
>
>
> ________________________________
> From: Art Lorenzini <dbalorenzini@...>
> To: "MS_Access_Professionals@yahoogroups.com" <MS_Access_Professionals@yahoogroups.com>
> Sent: Wednesday, April 4, 2012 3:17 PM
> Subject: Re: [MS_AccessPros] Re: Display backend file path and file name
>
>
> Â
> My two cents
> Â
> I put it in my form load.
> Â
> Private Sub Form_Load()
> Â Me.txtFileLocation = DLookup("Database", "MSysObjects", "Name='tblUnit'")
> Â
> End Sub
>
> With warm regards,
>
> Arthur Lorenzini
> Sioux Falls, South Dakota
>
> ________________________________
> From: Jim Wagner <luvmymelody@...>
> To: "MS_Access_Professionals@yahoogroups.com" <MS_Access_Professionals@yahoogroups.com>
> Sent: Wednesday, April 4, 2012 5:08 PM
> Subject: Re: [MS_AccessPros] Re: Display backend file path and file name
>
>
> Â
>
> Bill,
>
> I cannot get the expression to work. I kind of came into the thread a little late. I put it on a text box on a form. Can you explain it a little clearer for the challenged.
> Â
> Jim Wagner
> ________________________________
>
> ________________________________
> From: Bill Mosca <wrmosca@...>
> To: MS_Access_Professionals@yahoogroups.com
> Sent: Wednesday, April 4, 2012 2:42 PM
> Subject: [MS_AccessPros] Re: Display backend file path and file name
>
> Â
> You're welcome, Art. If you poke around in the system tables you'll find all kinds of cool stuff.
>
> Bill
>
> --- In MS_Access_Professionals@yahoogroups.com, Art Lorenzini <dbalorenzini@> wrote:
> >
> > Biil,
> > That was outstanding. I like it when it's that simple... :)
> >
> >
> >
> > With warm regards,
> >
> > Arthur Lorenzini
> > Sioux Falls, South Dakota
> >
> >
> >
> >
> >
> >
> > ________________________________
> > From: Bill Mosca <wrmosca@>
> > To: MS_Access_Professionals@yahoogroups.com
> > Sent: Wednesday, April 4, 2012 4:07 PM
> > Subject: [MS_AccessPros] Re: Display backend file path and file name
> >
> >
> >
> > ÂÂ
> >
> > Art
> >
> > The path is stored in the hidden MSysObjects table. A quick DLookup would be something like:
> > DLookup("Database", "MSysObjects", "Name='YourTableNameGoesHere'")
> >
> > To see the tables in 2003, Click on Tools>Options>View. Check the box for System Tables.
> >
> > In 2007/2010, Right-click the Navigation Pane header. Select Navigation Options.
> >
> > Regards,
> > Bill Mosca, Founder - MS_Access_Professionals
> > http://www.thatlldoit.com
> > Microsoft Office Access MVP
> > https://mvp.support.microsoft.com/profile/Bill.Mosca
> >
> > --- In MS_Access_Professionals@yahoogroups.com, "Art" <dbalorenzini@> wrote:
> > >
> > > Is there a way to display the path and name of the backend file in a text box?
> > >
> > > Thanks
> > >
> > > Art Lorenzini
> > > Sioux Falls
> > >
> >
> >
> >
> >
> > [Non-text portions of this message have been removed]
> >
>
> [Non-text portions of this message have been removed]
>
> [Non-text portions of this message have been removed]
>
>
>
>
> [Non-text portions of this message have been removed]
>

[Non-text portions of this message have been removed]

__._,_.___
.

__,_._,___

Tidak ada komentar:

Posting Komentar