Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Regisry update error 1

Status
Not open for further replies.

joeschoe

Programmer
Jan 13, 2002
67
IL
I need to update a registry entry from 1 to 2.
I get a return code of 5 which translates as ERROR_CANTWRITE .
I can update the entry manually without problem but I need it in a setup procedure.
Here is my specific code
Code:
  r = RegOpenKeyEx(HKEY_LOCAL_MACHINE, _
    "SOFTWARE\Microsoft\MSSQLServer\MSSQLServer", 0, KEY_READ, hKey)
    r = SetValueEx(hKey, "LoginMode", 4, 2)
    If r = 0 Then
        MsgBox "successful update"
    Else
        MsgBox "update returned code of " & Str(r)
    End If
Any suggestions?
 
Code:
r = RegOpenKeyEx(HKEY_LOCAL_MACHINE, _
    "SOFTWARE\Microsoft\MSSQLServer\MSSQLServer", 0, KEY_READ, hKey)

I'd look at parameter number 4 (KEY_READ) - the clue might be in the name...

Take Care

Matt
If at first you don't succeed, skydiving is not for you.
 
Glad to help

Take Care

Matt
If at first you don't succeed, skydiving is not for you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top