473,320 Members | 1,920 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

determine path to opened database

I'm looking for a way to find out, for instance with a system variable, the
path to the currently opened database.
The purpose is that someone can put the database on a location he or she
want's and that a piece of VBA code determines which is the path the
database is located.

Thnx in advance
Nov 12 '05 #1
2 5453
You can get the path name with the follwing function:

Public Function dbPath() As String

dbPath = CurrentDb.Name
dbPath = Left(dbPath, Len(dbPath) - Len(Dir(dbPath)))

End Function
--
Albert D. Kallal (MVP)
Edmonton, Alberta Canada
ka****@msn.com
http://www.attcanada.net/~kallal.msn
Nov 12 '05 #2
Albert,

thnx.
This is what i'm looking for

Peter
"Albert D. Kallal" <NO************@msn.com> wrote in message
news:XLCjb.108408$6C4.28233@pd7tw1no...
You can get the path name with the follwing function:

Public Function dbPath() As String

dbPath = CurrentDb.Name
dbPath = Left(dbPath, Len(dbPath) - Len(Dir(dbPath)))

End Function
--
Albert D. Kallal (MVP)
Edmonton, Alberta Canada
ka****@msn.com
http://www.attcanada.net/~kallal.msn

Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Me | last post by:
Hi all, I have an Access application that has to import hundreds of other MDB's, some access 97 and some 2000, and merge them into several large mdb's. so far so good, but my command: Set...
1
by: Steven | last post by:
Hello, I have a problem in using TreeView. I want to remember the path I have accessed. When I open the dialog of this TreeView next time , it could be opened automatically. Does anyone can...
3
by: KSC | last post by:
Hello, Is there a way to programmatically determine if a directory is shared and if so, what the sharename is? It seems a simple question, but I have been searching and not found the...
40
by: Jeff | last post by:
I have a system on a network and want to determine if anyone is currently connected to the back-end files. An interesting twist is that I have noticed that some users can be connected (have the...
11
by: Daz | last post by:
Would anyone know of a way to check whether or not a particular path is a directory? If I have to go down the route of using _findfirst and _findnext (windows specific), then so be it. However, I...
7
by: Tony K | last post by:
How can I customize, at runtime, the path for the OLEDB connection uses. I used the Add Data Source Wizard and found the path set by the wizard is ReadOnly.
6
by: None | last post by:
Hello, my app is written in C#. Given an app file path (e.g. e:\abc.exe), how can I determine if it's a winform app or a console one. (note: abc.exe can be either a native exe or a .net one)
16
by: Steve | last post by:
I am working on a database that has a main menu, many sub-menus and some sub-sub-menus. They are all forms that have numerous command buttons on them to open forms and reports in the database. The...
3
by: ronnysaid | last post by:
Dear All, I was wondering if there is a way to reset the "Save As dialog" initial path when the user clicks on Save as from the menu. As an example, if you opened a workbook from interop (C#,...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.