Calling DB Property Fields

irish634

Registered User.
Local time
Yesterday, 19:06
Joined
Sep 22, 2008
Messages
230
Is there a way to read the database property fields from "FILE" --> "DATABASE PROPERTIES" (see attached image).

Untitled-1 copy.jpg

I know how to call and change the startup properties, but haven't found out how to do this one yet.

Thanks,
Craig
 
without testing or checking it will be something like

Code:
dim prp as property

for each prp in application.properties
  msgbox(prp.name)
next

there will be some collection (application maybe) that stores a collection of properties, which you can iterate in this way. The properties themsleves may have collections of attributes, or other properties. Help should point you in the right direction.
 
Well I found this and am able to get the data on the summary tab:

Code:
Function GetSummaryInfo(strPropName As String) As String 
On Error GoTo Err_GetSummaryInfo 

Dim dbCurr As DAO.Database 
Dim cntCurr As DAO.Container 
Dim docCurr As DAO.Document 
Dim prpCurr As DAO.Property 

' Property not found error. 
Const conPropertyNotFound As Long = 3270 
     
    Set dbCurr = CurrentDb 
    Set cntCurr = dbCurr.Containers!Databases 
    Set docCurr = cntCurr.Documents!SummaryInfo 
    docCurr.Properties.Refresh 
    GetSummaryInfo = docCurr.Properties(strPropName) 

End_GetSummaryInfo: 
    Exit Function 

Err_GetSummaryInfo: 
    If Err = conPropertyNotFound Then 
        Set prpCurr = docCurr.CreateProperty(strPropName, dbText, "None") 
        docCurr.Properties.Append prpCurr 
        GetSummaryInfo = "None" 
        Resume Next 
    Else 
        GetSummaryInfo = "" 
        Resume End_GetSummaryInfo 
    End If 

End Function

Anyone know how to get the info from the "Custom Tab?" Switching "SummaryInfo" with "CustomInfo" isn't it.
 
Anyone know how to get the info from the "Custom Tab?" Switching "SummaryInfo" with "CustomInfo" isn't it.


Got it....
It's "UserDefined"

So to get items from the "Custom Tab" change
cntCurr.Documents!SummaryInfo to cntCurr.Documents!UserDefined
 
are you there now? is it making sense?

i think i may have looked at this once before, and decided I didnt want the stuff

but its not at all obvious on stuff like this exactly how to write the code to interrogate/create the properties, eben if you know roughly what you are trying toachieve
 
are you there now? is it making sense?

i think i may have looked at this once before, and decided I didnt want the stuff

but its not at all obvious on stuff like this exactly how to write the code to interrogate/create the properties, eben if you know roughly what you are trying toachieve

Yes I have it.
I was looking to retrieve the info because I am using it in an "About" form. Doing it this way I can use the form for other apps and just fill out the properties.
 

Users who are viewing this thread

Back
Top Bottom