🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.databases.ms-access
Article #354

Re: Simple one! Get path?

#354
From: Radu Lascae
Date: Thu, 08 Apr 1999 00:00
37 lines
1904 bytes
Hi Yves,

This code was first posted by David McTavish.

Function GetDBDir()
'returns the path to the current database
Dim db As Database          'database object
Dim tPath As String         'temporary path

'configure the database object
Set db = CurrentDb

'set the temporary path the path to the database
tPath = db.Name

'loop through the temporary path and truncate to each backslash (\)
Do While InStr(tPath, "\") > 0
    GetDBDir = GetDBDir & Left(tPath, InStr(tPath, "\"))
    tPath = Right(tPath, Len(tPath) - InStr(tPath, "\"))
Loop

'close the database object
db.Close

End Function

Hth,
Radu
Yves wrote:

> How can I get the path of my .mdb.  Like in Excel it's
> Workbooks("Application.xls").Path, but I don't know what's the same in
> Access
>
> Thanks!!!
>
> Yves
Technical Details
Message-ID: <370CD4D4.882778@ind.tno.nl>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <W64P2.26284$Ib4.19208@news21.bellglobal.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 101bdd,1d729218bc5d7f46
X-Google-Attributes: gid101bdd,public
X-Google-Thread: 111a5a,1d729218bc5d7f46
X-Google-Attributes: gid111a5a,public
X-Google-Thread: ff0ac,1d729218bc5d7f46
X-Google-Attributes: gidff0ac,public
X-Google-Thread: 102b1d,1d729218bc5d7f46
X-Google-Attributes: gid102b1d,public
X-Google-Thread: 1163bd,1d729218bc5d7f46
X-Google-Attributes: gid1163bd,public
X-Google-Thread: fe218,1d729218bc5d7f46
X-Google-Attributes: gidfe218,public
From: Radu Lascae <R.Lascae@ind.tno.nl>
Subject: Re: Simple one! Get path?
Date: 1999/04/08
Message-ID: <370CD4D4.882778@ind.tno.nl>
X-Deja-AN: 464082106
Content-Transfer-Encoding: 7bit
References: <W64P2.26284$Ib4.19208@news21.bellglobal.com>
X-Accept-Language: en
Content-Type: text/plain; charset=us-ascii
Organization: TNO Industrie
Mime-Version: 1.0
Newsgroups: comp.databases.ms-access,de.comp.datenbanken.ms-access,es.comp.bd.ms-access,microsoft.public.access.forms,microsoft.public.access.formscoding,microsoft.public.access.formsprogramming