Database Properties - Custom Tab

Randomblink

The Irreverent Reverend
Local time
Today, 15:37
Joined
Jul 23, 2001
Messages
279
I have gone into my Database Properties.

I have gone to the custom tab.

I have created a custom properties called: ReplicaVersion

How can I capture that?

For Instance...

label_Test.Caption = "This is version: " & ReplicaVersion

I have exhausted my brain for today. I will work on it tomorrow, unless someone already has that answer...

Thanks in advance!
 
Have you tried:

Currentdb.properties("Your Property Name")
 
CurrentDb.Properties ("ReplicaVersion")

Yes I have.

I get a type error.

There is something about User Defined Custom properties are located in the Document area? Something concerning Containers or Documents?

If you goto help and type in "Database Properties" you run into this.

In Microsoft Access databases (.mdb), the custom properties you enter become properties of the UserDefined Document object in the Documents collection.

Help me Obi Won Kenobi, your our only hope.
 
Last edited:
Goto Microsofts Knowledge Base on the Web.

Look for this article:

ACC: Using DAO to Set and Retrieve Custom Database Properties
ID: Q178745
 
UserDefined

I have been, and they all say to do the following:

Dim dbs As Database

dbs = CurrentDb

I get errors everytime...

Something about UserDefined Types?

Argh!
 
Is the DAO Reference in your MDB file?
 
...

Uh, I guess I am gonna sound stupid...

Well, here goes...

How do I put the DAO reference in my MDB?
 
open 1 of your VB modules.
click on the tools button on the menu bar.
click on the references selection of the drop down menu.

scroll down until you find "Microsoft DAO 3.51 Object Library".
click the check box to put a tick in it.

click apply or ok or whatever is at the bottom of the reference box.

close the module.

hey presto should now work for you.

ian
 
DAO 3.5 Library Reference

Statement: Now that I did this, I got an error message saying conflicting references or something, but if I UNCLICK DAO 3.6 then everything is fine...

Question: Is this good?
 
What References do you have? Please list them.
 
Reference List:

Visual Basic For Applications
Microsoft Access 9.0 Object Library
OLE Automation
Microsoft ActiveX Data Objects 2.1 Library
Microsoft Calendary Control 9.0
Microsoft Windows Common Controls-2 6.0 (SP3)
Animation GIF Control
FolderTree ActiveX Control Module
Microsoft Shell Controls and Automation
Microsoft VBScript Globals
Microsoft VBScript Regular Expressions
Microsoft DAO 3.51 Object Library

That is all of the checked options.
(Thanks for helping with this...I got everything working right now, but I am sure that figuring this out will make life better!)
 
To add the DAO 3.6 Reference you must remove the DAO 3.51 reference. That will take care of the confilict Error.
 
Um...

If I remove the 3.51 reference...

Then I can't utilize the options I was talking about at the beginning of this message?!
 
Thats why you add the DAO 3.6 Reference. Its the update.
 
ARGH!

Currentdb.properties("Your Property Name")
Doesn't work in 3.6....I had 3.6 already, had to install 3.51 to get it to work...and with 3.51, it worked, but 3.6 had to be removed...
 
Brian,

The following code works under DAO 3.51 and DAO 3.6.

Code:
Dim dbs as Database
Dim doc as Document

Set dbs = CurrentDB()
Set doc = dbs.Containers("Databases")!UserDefined

label_Test.Caption = "This is version: " & doc.Properties!ReplicaVersion 

Set doc = nothing
Set dbs = nothing
HTH
SteveA :cool:
 
Then something is wrong

When I do Dim XXX as Database...


I get User-Type not defined under 3.6
Bu not when I remove 3.6 and use 3.51

At least on my machine...
 
Try Dim dbs As DAO.Database, under DAO 3.6
 
Last Question

What if I want to check a database on the server?

CurrentDb grabs the current database...
How do I point to one on the server?
 
Never Mind

I use the following function and it grabs the information...
I just got back from a New Horizons (Computer Learning Lab) on VB6 and was able to finagle some of what I learned into figuring this out for myself...excitement galore...

Public Function GetMasterVersion() As String
Dim wrkJet As Workspace
Dim dbs As Database, cnt As Container
Dim doc As Document, prp As Property

' Property not found error.
Const conPropertyNotFound = 3270
On Error GoTo GetSummary_Err

Set wrkJet = CreateWorkspace("", "Admin", "")
Set dbs = wrkJet.OpenDatabase("\\PWC\Engineering\wpdata\reports\Databases\Front_End_Databases\Tmpl_ProjectStatus.mdb")
Set doc = dbs.Containers("Databases")!UserDefined
GetMasterVersion = doc.Properties("ReplicaVersion")
dbs.Close
wrkJet.Close
Set doc = Nothing
Set dbs = Nothing

GetSummary_Bye:
Exit Function

GetSummary_Err:
If Err = conPropertyNotFound Then
MsgBox "There is no Replica Version number assigned."
Resume
Else
' Unknown error.
MsgBox Err.Description
Resume GetSummary_Bye
End If
End Function

There it is in all it's glory...
 

Users who are viewing this thread

Back
Top Bottom