Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Access 2003 VBA Programmer's Reference
This is the forum to discuss the Wrox book Access 2003 VBA Programmer's Reference by Patricia Cardoza, Teresa Hennig, Graham Seach, Armen Stein; ISBN: 9780764559037
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Access 2003 VBA Programmer's Reference section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old December 23rd, 2005, 04:52 AM
Registered User
Join Date: Mar 2005
Location: Tallinn, , Estonia.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Setting "DBEngine.SystemDB" property

I have a problem with setting a DBEngine.SystemDB property.
I am using Excel and want to make connection to secured
Access .mdb file.

Every time when I set DBEngine.SystemDB property, it does not work:

My setting in Excel VBA:
DBEngine.SystemDB="Q:\ham\Companies_database\HAIDA TA\DATA\Testimine\HAIEquitySecutiry.mdw"

But after executing Debug.Print DBEngine.SystemDB
I receive:
"C:\Documents and Settings\jyrik\Application Data\Microsoft\Access\System.mdw"

It means DBEngine.SystemDB proprty remains to default value!
What is wrong?

Jüri Kuusik.
Old December 25th, 2005, 03:10 PM
Authorized User
Join Date: Sep 2004
Location: Nanaimo, BC, Canada.
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts

The SystemDB is the Database work group file, i.e. the file that normally is used for security purposes.

What does your code look like?
I am assuming you are setting a reference to DAO in your code?

Usually you just use the OpenDatabase method to open a database.

Database Agreements
Old December 28th, 2005, 06:51 AM
Registered User
Join Date: Mar 2005
Location: Tallinn, , Estonia.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts


Public Sub ActionSecDBAdmin(strAction As String, _
                            strPrimaryTab As String, _
                            strForeignTab As String, _
                            Optional strRelName As String, _
                            Optional ForeignFieldName As String)

    Dim wrkspTempWorkspace As DAO.Workspace
    Dim strSecureDB As String
    Dim strUserName As String
    Dim strPassword As String
    Dim strGroupFile As String

    On Error GoTo Errors

    strGroupFile = PublicFolder & DatabaseGroup
    'PublicFolder - folder
    'DatabaseGroup - .mdw file

    'Workgroup file:
        DBEngine.SystemDB="Q:\ham\Companies_database\HAIDA TA\DATA\Testimine\HAIEquitySecutiry.mdw"

 ' !!! Problem is here: DBEngine.SystemDB remains default .mdw file
       ' (System.mdw file in C: drive)

        strUserName = "UserX"
        strPassword = "PasswordX"

    'New temporary workspace

        Set wrkspTempWorkspace = DBEngine.CreateWorkspace("New", strUserName, strPassword)

        DBEngine.Workspaces.Append wrkspTempWorkspace

    'Open secured database
        strSecureDB = PublicFolder & DatabaseFile
        Set dbSecureDB = _
            DBEngine.Workspaces("New").OpenDatabase(strSecureD B)

    'Action with database...

End Sub

Jüri Kuusik.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting property value of class - objectdatasouce ranjan74feb ASP.NET 2.0 Professional 0 October 20th, 2007 03:51 AM
DefaultValue Property Setting Failing SerranoG Access VBA 5 April 2nd, 2007 12:40 PM
Setting Property for a Custom Control cadaats C# 0 October 17th, 2005 02:22 AM
Setting ReadOnly Property Values Gavin265 General .NET 8 May 19th, 2005 12:49 PM
setting the ReadOnly property with a function creative_eye General .NET 3 May 10th, 2004 03:27 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.