Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Custom Database Properties with Access Project

Status
Not open for further replies.

peterben

Programmer
Nov 20, 1999
7
GB
I have been using Custom Database Properties with Access 97 and 2000 with no problems but my code no longer works when I use it in an Access Project.

The code is as follows to get the value of TestingYesNo which is a Boolean value

Dim dbs As Database
Dim doc As Document
Dim Testing As Boolean

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

Testing = doc.Properties!TestingYesNo

Microsoft DOA 3.6 Object Library is set

My Access Project lets me add Custom Database Properies from the Database Window but I can't find a way to get to the Property I have set up.

Any suggestions

Peterben
 
If you have an Access Project then you must be connecting to sql server where all the tables reside. The functions you indicate are DAO functions. Use ADO for Access Projects. Explain your requirement, if you need assistance with ADO.
 
Thanks cmmrfrds for your comments...With a bit of reading I have found out that I can now Add a Property using

CurrentProject.Properties.Add "PropertyName","PropertyValue"

Property Value can be an Integer, String or Boolean

I can then read the Property Added Using

CurrentProject.Properties.Item(n).Name
CurrentProject.Properties.Item(n).Value

Where n is an index.

What I have deduced from this is

1 With an Access Project the Properties are now associated with the SQL Server Database (Which is what cmmrfrds was saying).

2 They are only accessible with VBA


3 That although Custom Database Properties can be added via the Database Properties Custom Tab they are no longer available with VBA.

Peterben




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top