How to return database name in correct format

dorisr

Programmer Analyst
Local time
Today, 18:36
Joined
May 5, 2008
Messages
15
Hi all,

I've used this function to get the MsAccess database name :

Function GetDbName()
'Returns the filename of the currently opened MDB

GetDbName = CurrentProject.Name
End Function


and it worked. But the database name is in this format : ThisIsTheDatabaseName.mdb. The problem is that it returns this in all lowercasing : thisisthedatabasename.mdb.

Can anyone give me a method to return in the same format lowercase & uppercase as the file name ?

Thanks,
Doris
 
seriously, why is this a problem

you can ucase or lcase it, to change the case if you want to

-------
other than that

currentdb.name will give you the fully specified path/fiename respecting your capitalisation, but you will have to split the name off

there may be inbuilt functions to do split folder/filname in later versions, but I dont think there was in A97
 
seriously, why is this a problem

you can ucase or lcase it, to change the case if you want to

-------
other than that

currentdb.name will give you the fully specified path/fiename respecting your capitalisation, but you will have to split the name off

there may be inbuilt functions to do split folder/filname in later versions, but I dont think there was in A97
Thanks Gemma-the-husky,
I use another program to open my ms access database... An when I open the ms access database directly it works well it respect my dbname capitalization. But when I use the other program that opens my ms access database, the database name is all lowercase... I display the dbname in a textbox form.

I don’t know it ms access has some built in function to always respect capitalization...

Doris
 

Users who are viewing this thread

Back
Top Bottom