Wrox Programmer Forums
|
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 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 August 21st, 2013, 02:25 PM
Registered User
 
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
 
Old August 21st, 2013, 03:47 PM
gjgriffith's Avatar
Wrox Author
 
Join Date: Jul 2009
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! *** ---------------------------------------------------------------------------------------------------------->
 
Old August 22nd, 2013, 02:34 AM
gjgriffith's Avatar
Wrox Author
 
Join Date: Jul 2009
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! *** ---------------------------------------------------------------------------------------------------------->
The Following User Says Thank You to gjgriffith For This Useful Post:
gimmieknowledge (August 22nd, 2013)
 
Old August 22nd, 2013, 08:56 AM
Registered User
 
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.
 
Old August 23rd, 2013, 10:11 AM
gjgriffith's Avatar
Wrox Author
 
Join Date: Jul 2009
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! *** ---------------------------------------------------------------------------------------------------------->
The Following User Says Thank You to gjgriffith For This Useful Post:
gimmieknowledge (August 23rd, 2013)





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





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