Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / September 2006

Tip: Looking for answers? Try searching our database.

Reading Database Property Values

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Davina - 29 Sep 2006 07:59 GMT
I want to be able to verify the value of a custom property for my database. I
have an application that I want to be able to set either as a single or
multi-client version, and to verify which version type it is. I am using
Access2003 and the help shows how to add and delete, but not view the value.

Thank you
Dirk Goldgar - 29 Sep 2006 08:07 GMT
> I want to be able to verify the value of a custom property for my
> database. I have an application that I want to be able to set either
> as a single or multi-client version, and to verify which version type
> it is. I am using Access2003 and the help shows how to add and
> delete, but not view the value.

I don't know what type of data your "version" property is.  I often set
a numeric Version property, which I retrieve like this:

'----- start of code -----
Function fncAppVersion() As String

   On Error Resume Next

   Dim dblVersion As Double

   dblVersion =
DBEngine.Workspaces(0)(0).Containers("Databases").Documents("UserDefined
").Properties("Version")

   fncAppVersion = Format(dblVersion, "0.00")

End Function

'----- end of code -----

Note: the line that actually assigns the value to dblVersion will have
been broken onto two lines by the newsreader, but it was originally all
one line.

Signature

Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

Davina - 30 Sep 2006 08:02 GMT
Dirk,

    Thank you.  I will use your idea for another problem I was having.  My
original question had to do with reading the Custom Tab of the Database
Properties dialog box. I discovered how to use the CreateProperty method to
add the custom property to the application and retrieve it also.  This I
think is a better way of doing it since the information does not show even on
the tab, so the end-users do not have access to view it.  I have included my
code below.

Public Sub setmulti() 'creates and sets property

Dim prop As Property

Set prop = CurrentDb.CreateProperty("multimc", dbBoolean, True)
CurrentDb.Properties.Append prop
End Sub

Public Sub viewmulti() 'retrieves and displays property value

MsgBox CurrentDb.Properties("multimc").Name & " = " &
CurrentDb.Properties("multimc").Value

End Sub

Public Sub multimcchange() 'Changes property value

   CurrentDb.Properties("multimc").Value = False

End Sub
Signature

Davina Lightner

> > I want to be able to verify the value of a custom property for my
> > database. I have an application that I want to be able to set either
[quoted text clipped - 25 lines]
> been broken onto two lines by the newsreader, but it was originally all
> one line.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.