Best way to read & write registry values in Access 2013?

Hello - I've been asked to get a Access 2003 app working in Office 2013, and one of the things that is broken is a missing library reference to Microsoft Office XP Web Components.

I gather from searches that it's no longer supported.  

So, how do you read & write registry values in Access 2013?

What I need to do specifically is write a registry key that prevents the SQL Server Security check message that pops up when you do a mail merge (since about Access 2003?)

Thanks in advance for your help


Public Function ChkRpaKeys(RKey As String, RName As String) As Long

    '-- check for the "SQLSecurityCheck" registry key...
    Dim lngRetVal As adhRegErrors
    Dim strValue As String
   
    Const adhcMaxDataSize = 1024

    strValue = Space(adhcMaxDataSize)
   
    lngRetVal = adh_accRegGetVal(adhcHKEY_CURRENT_USER, RKey, RName, strValue, Len(strValue))
   
    If lngRetVal = adhcAccErrSuccess Then
        'MsgBox "Registry Key Found - Value: " & vbCrLf & vbCrLf & strValue
    Else
        lngRetVal = adh_accRegWriteVal(adhcHKEY_CURRENT_USER, RKey, RName, 0, adhcREG_DWORD)
        'MsgBox "Registry Key Created"
    End If

End Function
mlagrangeAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
You can use the Scripting library to do this:

Dim WshShell AS Object
Set WshShell = WScript.CreateObject("WScript.Shell")

WshShell.RegWrite "HKCU\Software\Microsoft\FortuneTeller\", 1, "REG_BINARY"
WshShell.RegWrite "HKCU\Software\ACME\FortuneTeller\MindReader", "Goocher!", "REG_SZ"

See this article:
https://msdn.microsoft.com/en-us/library/yfdfhz1b

Or you can use my posting from here to use API functions:

http://www.experts-exchange.com/Database/MS_Access/Q_21082306.html

If you use that, copy and paste the code from the accepted answer into a new module, then write the key like this:

RegWrite "Software\SomeNode\SomeSubNode", "MyNewValue", 0, HKEY_CURRENT_USER, DWordType
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mlagrangeAuthor Commented:
Thanks, Scott!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.