Change the startup options in a database from a separate database

S

SHIPP

I am utilizing Access 97. I am writing the code to break an employee database
down into 70 separate databases (one for each manager containing their
employees only). This is due to the Sarbanes-Oxley Act. This is a Fortune 50
company. I have been directed by the CEO and their Auditing firm to make this
iron clad. The only way to accomplish this is to create individual databases
that only contain that managers data. This data is proprietary to the
specific manager. This is going just fine. What I need to know is once I
create the individual
databases how do I set the start-up options in each one of my sub-databases
from my Master Database utilizing VB. Thanks in advance.

I have written the following code which changes the Title and form in the
current database. How do I adjust the code to direct the changes to a
different database?

When I subsititue

Set dbs = DBEngine.Workspaces(0).OpenDatabase(strDBName)

for

Set dbs = CurrentDb

I get an error message at

Set prp = dbs.CreateProperty(strName, varType, varValue)

saying Error 13 Type Mismatch.

Any help would be appreciated.


Function AddAppProperty(strName As String, varType As Variant, varValue As
Variant, strDBName As String) As Integer

Dim dbs As database, prp As Property
Const conPropNotFoundError = 3270

Set dbs = CurrentDb
' Set dbs = DBEngine.Workspaces(0).OpenDatabase(strDBName)
On Error GoTo AddProp_Err
dbs.Properties(strName) = varValue

AddAppProperty = True

AddProp_Bye:
Exit Function

AddProp_Err:
If Err = conPropNotFoundError Then
Set prp = dbs.CreateProperty(strName, varType, varValue)
dbs.Properties.Append prp
Resume
Else
AddAppProperty = False
Resume AddProp_Bye
End If
End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top