473,396 Members | 1,871 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,396 software developers and data experts.

Getting the name of the database, is there a varialbe?

I want to display the name of the current database on a report. For
example, if the database is "db1.mdb", I want it to say "db1.mdb" somewhere
on the report. I could put a label with the value "db1.mdb" in it on the
report, but if the database were copied to another name, that label would be
incorrect.

Robert
Nov 13 '05 #1
7 1474
Try this

right(currentdb.Name,Len(currentdb.name) -instrrev(currentdb.Name,"\"))

CurrentDb.name is the full path of your database. We then start searching
from the end backwards to find the first occurrence of a "\"

Phil
"Robert" <pr**********@yahoo.com> wrote in message
news:fP*******************@fe06.lga...
I want to display the name of the current database on a report. For
example, if the database is "db1.mdb", I want it to say "db1.mdb" somewhere
on the report. I could put a label with the value "db1.mdb" in it on the
report, but if the database were copied to another name, that label would
be incorrect.

Robert

Nov 13 '05 #2
Another possibility:
=CurrentProject.Name

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Phil Stanton" <di********@stantonfamily.co.uk> wrote in message
news:41*********************@mercury.nildram.net.. .
Try this

right(currentdb.Name,Len(currentdb.name) -instrrev(currentdb.Name,"\"))

CurrentDb.name is the full path of your database. We then start searching
from the end backwards to find the first occurrence of a "\"

Phil
"Robert" <pr**********@yahoo.com> wrote in message
news:fP*******************@fe06.lga...
I want to display the name of the current database on a report. For
example, if the database is "db1.mdb", I want it to say "db1.mdb"
somewhere on the report. I could put a label with the value "db1.mdb" in
it on the report, but if the database were copied to another name, that
label would be incorrect.

Nov 13 '05 #3
Or mid(currentdb.Name, instrrev(currentdb.Name,"\") + 1)

"Phil Stanton" <di********@stantonfamily.co.uk> wrote in message
news:41*********************@mercury.nildram.net.. .
Try this

right(currentdb.Name,Len(currentdb.name) -instrrev(currentdb.Name,"\"))

CurrentDb.name is the full path of your database. We then start searching
from the end backwards to find the first occurrence of a "\"

Phil
"Robert" <pr**********@yahoo.com> wrote in message
news:fP*******************@fe06.lga...
I want to display the name of the current database on a report. For
example, if the database is "db1.mdb", I want it to say "db1.mdb"
somewhere on the report. I could put a label with the value "db1.mdb" in
it on the report, but if the database were copied to another name, that
label would be incorrect.

Robert


Nov 13 '05 #4
Thanks
"Phil Stanton" <di********@stantonfamily.co.uk> wrote in message
news:41*********************@mercury.nildram.net.. .
Try this

right(currentdb.Name,Len(currentdb.name) -instrrev(currentdb.Name,"\"))

CurrentDb.name is the full path of your database. We then start searching
from the end backwards to find the first occurrence of a "\"

Phil
"Robert" <pr**********@yahoo.com> wrote in message
news:fP*******************@fe06.lga...
I want to display the name of the current database on a report. For
example, if the database is "db1.mdb", I want it to say "db1.mdb"
somewhere on the report. I could put a label with the value "db1.mdb" in
it on the report, but if the database were copied to another name, that
label would be incorrect.

Robert


Nov 13 '05 #5
Thanks
"Allen Browne" <Al*********@SeeSig.Invalid> wrote in message
news:41**********************@per-qv1-newsreader-01.iinet.net.au...
Another possibility:
=CurrentProject.Name

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Phil Stanton" <di********@stantonfamily.co.uk> wrote in message
news:41*********************@mercury.nildram.net.. .
Try this

right(currentdb.Name,Len(currentdb.name) -instrrev(currentdb.Name,"\"))

CurrentDb.name is the full path of your database. We then start searching
from the end backwards to find the first occurrence of a "\"

Phil
"Robert" <pr**********@yahoo.com> wrote in message
news:fP*******************@fe06.lga...
I want to display the name of the current database on a report. For
example, if the database is "db1.mdb", I want it to say "db1.mdb"
somewhere on the report. I could put a label with the value "db1.mdb" in
it on the report, but if the database were copied to another name, that
label would be incorrect.


Nov 13 '05 #6
Thanks
"Neil Ginsberg" <nr*@nrgconsult.com> wrote in message
news:Sk******************@newsread3.news.pas.earth link.net...
Or mid(currentdb.Name, instrrev(currentdb.Name,"\") + 1)

"Phil Stanton" <di********@stantonfamily.co.uk> wrote in message
news:41*********************@mercury.nildram.net.. .
Try this

right(currentdb.Name,Len(currentdb.name) -instrrev(currentdb.Name,"\"))

CurrentDb.name is the full path of your database. We then start searching
from the end backwards to find the first occurrence of a "\"

Phil
"Robert" <pr**********@yahoo.com> wrote in message
news:fP*******************@fe06.lga...
I want to display the name of the current database on a report. For
example, if the database is "db1.mdb", I want it to say "db1.mdb"
somewhere on the report. I could put a label with the value "db1.mdb" in
it on the report, but if the database were copied to another name, that
label would be incorrect.

Robert



Nov 13 '05 #7

"Robert" <pr**********@yahoo.com> wrote in message
news:fP*******************@fe06.lga...
I want to display the name of the current database on a report. For
example, if the database is "db1.mdb", I want it to say "db1.mdb" somewhere
on the report. I could put a label with the value "db1.mdb" in it on the
report, but if the database were copied to another name, that label would
be incorrect.

Robert

Nov 13 '05 #8

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

Similar topics

5
by: Mike Turco | last post by:
(This was also posted to comp.database.ms-access before I realized this was the hep group.) Lets say that my WinXP computer has two users: Michael and Kathryn. One or the other logs into the...
1
by: Oleg Shnayderman | last post by:
Hi All, I am very new to C# as well as to SQL. I need to write an application which is connecting to SQL DB and getting all the user's tables and after create a dataset for all the tables in the...
6
by: Brett | last post by:
Not sure what the problem is here... Trying to update from a datagrid to an access database using vb.net... Its not updating the database but Im not getting any errors... Here is my code... ...
2
by: PHP_Paul | last post by:
Ok, I'm trying to poineer into the wonderful area of PHP/MySQL programming, but I'm having some difficulties. http://www.paulhq.com/php/freepage.html should register, but when anyone fills something...
3
by: George Varelas | last post by:
Hi. How can I change an object's name after I have created. For example I create an array as following "int mArray = new int" How can I change the name "mArray" and derive it from a combination...
6
by: nephish | last post by:
Hey there all. i have been looking to simplify my huge website that i wrote while learning php. now its a spaghetti mess. So, i wanted to simplify it. Now, i see the functionality that defining...
2
by: rustyc | last post by:
Well, here's my first post in this forum (other than saying 'HI' over in the hi forum ;-) As I said over there: ... for a little side project at home, I'm writing a ham radio web site in...
0
by: TG | last post by:
Hi! Once again I have hit a brick wall here. I have a combobox in which the user types the server name and then clicks on button 'CONNECT' to populate the next combobox which contains all the...
1
by: ahd2008 | last post by:
HI, I use the below code to filter records of the courses sub form !.Filter = "Courses. like '" & TypeofCourses & "'" & " and courses. like '" & CourseTitle & "'" !.FilterOn = True I...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.