Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
BOOK: Access 2010 VBA Programmer's Reference
This is the forum to discuss the Wrox book Access 2010 Programmer's Reference by Teresa Hennig, Rob Cooper, Geoffrey L. Griffith, Jerry Dennison; ISBN: 978-0-470-59166-6
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Access 2010 VBA Programmer's Reference 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 August 21st, 2013, 02:25 PM
Registered User
Points: 23, Level: 1
Points: 23, Level: 1 Points: 23, Level: 1 Points: 23, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2013
Posts: 6
Thanks: 3
Thanked 0 Times in 0 Posts
Smile Page 345 Windows Registry APIs

Hello all,
I have typed the necessary code starting on page 336 up to page 347. I am stepping through the code on pg 354 at the top under Public Function DeleteValue. I get an compile error msg stating that the variable KEY_ALL_ACCESS is not defined

' Open the key and get its handle
lngReturn = RegOpenKeyEx(lngRootKey, strSubKey, _
0&, KEY_ALL_ACCESS, hKey)

Can any one shed some light on this. I would appreciate it.
Thanks
Reply With Quote
  #2 (permalink)  
Old August 21st, 2013, 03:47 PM
gjgriffith's Avatar
Wrox Author
Points: 517, Level: 8
Points: 517, Level: 8 Points: 517, Level: 8 Points: 517, Level: 8
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2009
Location: Boulder, CO
Posts: 110
Thanks: 5
Thanked 14 Times in 14 Posts
Default Can you send me your code?

Hello Gimmieknowledge,

Thank you for posting in the "Access 2010 Programmer's Reference" forum. At this point, I'm wondering if you can send me your code so I can take a look? Please let me know when you have a chance!

Thanks,
__________________
Geoffrey L. Griffith
http://www.ImagineThought.com

Wrox Author of:
Microsoft Access 2010 24-Hour Trainer
Access 2010 Programmer's Reference
Access 2007 VBA Programmer's Reference

*** Please click the THANKS button (to the right) if this post helped you! *** ---------------------------------------------------------------------------------------------------------->
Reply With Quote
  #3 (permalink)  
Old August 22nd, 2013, 02:34 AM
gjgriffith's Avatar
Wrox Author
Points: 517, Level: 8
Points: 517, Level: 8 Points: 517, Level: 8 Points: 517, Level: 8
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2009
Location: Boulder, CO
Posts: 110
Thanks: 5
Thanked 14 Times in 14 Posts
Default Try this one...

Hello Gimmieknowledge,

So, I took a look at the sample files for this chapter (which you can download from here: http://www.wrox.com/WileyCDA/WroxTit...-DOWNLOAD.html), and I think I can help fix your problem here. It looks like the "KEY_ALL_ACCESS" constant that is used in the code you provided is defined in the "basRegistryFunctions" module of the "RegistrySamples.accdb" database file in the Chapter 10 sample code. I think you should be able to add the following line of code to the top of your VBA module where you use the "RegOpenKeyEx" function. The code should be:

Code:
Private Const KEY_ALL_ACCESS As Long = (( _
    STANDARD_RIGHTS_ALL _
    Or KEY_QUERY_VALUE _
    Or KEY_SET_VALUE _
    Or KEY_CREATE_SUB_KEY _
    Or KEY_ENUMERATE_SUB_KEYS _
    Or KEY_NOTIFY _
    Or KEY_CREATE_LINK) _
    And (Not SYNCHRONIZE))
Anyway, I hope that helps, but if you need anymore help on this, please just let me know and I'll do what I can to help. And thanks again for reading the Access 2010 Programmer's Reference!

Best Regards,
__________________
Geoffrey L. Griffith
http://www.ImagineThought.com

Wrox Author of:
Microsoft Access 2010 24-Hour Trainer
Access 2010 Programmer's Reference
Access 2007 VBA Programmer's Reference

*** Please click the THANKS button (to the right) if this post helped you! *** ---------------------------------------------------------------------------------------------------------->
Reply With Quote
The Following User Says Thank You to gjgriffith For This Useful Post:
gimmieknowledge (August 22nd, 2013)
  #4 (permalink)  
Old August 22nd, 2013, 08:56 AM
Registered User
Points: 23, Level: 1
Points: 23, Level: 1 Points: 23, Level: 1 Points: 23, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2013
Posts: 6
Thanks: 3
Thanked 0 Times in 0 Posts
Default Thanks again

griffith,
I spent some time going over your reply and over the code I typed from the book. Turns out I did have the code that you referenced included in my module. After hours of going over and over this code, it turns out that I had misspelled ACCESS in declaring my constant. One misspelled word and hours of frustration.
It was good practice on using the debugging tools.

Thanks again for your assistance.
Reply With Quote
  #5 (permalink)  
Old August 23rd, 2013, 10:11 AM
gjgriffith's Avatar
Wrox Author
Points: 517, Level: 8
Points: 517, Level: 8 Points: 517, Level: 8 Points: 517, Level: 8
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2009
Location: Boulder, CO
Posts: 110
Thanks: 5
Thanked 14 Times in 14 Posts
Default Glad to hear you got it worked out!

Hello Gimmieknowledge,

I'm so glad to hear that you found the problem in your code. I definitely recommend reusing the sample code for the book when possible, which can be found here: http://www.wrox.com/WileyCDA/WroxTit...-DOWNLOAD.html. And thank you again for reading the "Access 2010 Programmer's Reference" book, we truly appreciate your readership! If there is anything else I can do to help, please just let me know!

Best Regards,
__________________
Geoffrey L. Griffith
http://www.ImagineThought.com

Wrox Author of:
Microsoft Access 2010 24-Hour Trainer
Access 2010 Programmer's Reference
Access 2007 VBA Programmer's Reference

*** Please click the THANKS button (to the right) if this post helped you! *** ---------------------------------------------------------------------------------------------------------->
Reply With Quote
The Following User Says Thank You to gjgriffith For This Useful Post:
gimmieknowledge (August 23rd, 2013)
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
Page 345 - iterating through an xml file markhh ASP.NET 4 General Discussion 2 November 25th, 2011 11:49 AM
Windows registry ivanlaw Pro VB 6 7 November 19th, 2007 12:41 PM
Windows Registry Indraja VB.NET 0 June 6th, 2007 06:55 AM
Accessing Windows Task Manager through APIs vishnu_attur Visual C++ 1 September 1st, 2005 05:31 PM
Windows Registry kumar_rajeshk Pro VB 6 6 April 29th, 2004 01:08 AM



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


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