Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 3rd, 2003, 11:22 AM
Authorized User
 
Join Date: Dec 2003
Location: , , United Kingdom.
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default Database Path

I am using the below code to disable the shift key that by passes a macro. How do i determine the path of the databse that I want it to affect?

Sub SetStartupProperties()

    ChangeProperty "AllowBypassKey", dbBoolean, False

End Sub



Function ChangeProperty()

    Dim strPropName As String

    Dim varPropType As Variant

    Dim varPropValue As Variant



    Dim dbs As Database, prp As Property

    Const conPropNotFoundError = 3270

    strPropName = "AllowBypassKey"

    varPropType = dbBoolean

    varPropValue = False

    Set dbs = I NEED THE PATH HERE

    On Error GoTo Change_Err

    dbs.Properties(strPropName) = varPropValue

    ChangeProperty = True

MsgBox "Welcome to First Choice"

Change_Bye:

    Exit Function



Change_Err:

    If Err = conPropNotFoundError Then ' Property not found.

        Set prp = dbs.CreateProperty(strPropName, varPropType, varPropValue)

        dbs.Properties.Append prp

        MsgBox "Please Try Again"

        Resume Next

    Else

        ' Unknown error.

        MsgBox "ok"

        ChangeProperty = False

        Resume Change_Bye

    End If

End Function







Sam Powell
Information Systems Officer
Neath Port Talbot College
__________________
Sam Powell
Information Systems Officer
Neath Port Talbot College
Reply With Quote
  #2 (permalink)  
Old December 4th, 2003, 07:37 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Melbourne, Vic, Australia.
Posts: 308
Thanks: 0
Thanked 0 Times in 0 Posts
Default

do you want to do it to a different DB? i.e not the one that this code is in?

if not, then just use CurrentDB, (or just type in AllowBypassKey into VBA help, and paste the example there)

if so, here's a page that shows you just about everything you would want to know about finding paths and the like:
http://www.sloppycode.net/fso/


I am a loud man with a very large hat. This means I am in charge
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Path to database takwirira ASP.NET 2.0 Basics 2 April 4th, 2008 09:25 AM
Path to database backend Clive Astley Beginning VB 6 3 January 12th, 2007 01:29 AM
Implementing the all-path shortest path problem bitwords XSLT 1 December 6th, 2006 11:37 AM
using app.path in database path and filename kd8con VB Databases Basics 2 October 25th, 2006 11:45 AM
Invalid database Path MrDannyP VB Databases Basics 1 January 7th, 2004 10:15 AM



All times are GMT -4. The time now is 09:40 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.