delphi - Why do my registry writes report no error but have no effect? -


I am trying to create a new system DSN entry when my service is installed, by typing the registry through the Had tried to. Openky and Trajestery WrightString, but no value is being written. Of the three keys I am writing, I work fine.

  const sODBCRegKeyLoc = '\ software \ oDBC \ oDBCIII \ obdc data source'; SServerRegKeyLoc = '\ SOFTWARE \ ODBC \ ODBC.INI \ DSN Name'; RInstall: = TRegistry.Create (KEY_READ or KEY_WRITE); Try rInstall.RootKey: = HKEY_LOCAL_MACHINE; If rInstall.OpenKey (sRegKeyLoc, True) then Rinstall Write string ('Description', 'Monitors for new log entries.') Allows modification; RInstall.CloseKey; End; // This call works fine if rInstall.OpenKey (sODBCRegKeyLoc, True) then RINTL Arct string ('DSN name', 'SQL Native Client') starts; End; // If this call fails with an error message, then rInstall.OpenKey (sServerRegKeyLoc, True) then Aristoteles Start the right string ('driver', 'c: \ windows \ system32 \ sqlncli.dll'); RInstall.WriteString ('server', 'serverIP \ SQLEXPRESS'); rInstall.WriteString ('database', 'database name'); End; // This call fails with any error message RISTOL in the end. free; End; // Write the value for the registry.   

Any help would be appreciated.

The following possible failure methods come to mind:

  1. Your process There is no clear and even virtualized. Writes the successful but virtual data store in the land.
  2. There is a manifest in your process but the process not exceeded is not virtualized. Attempting to open the key to write under HKLM fails, but your code fails that error Fails to report
  3. The process is 32 bit and therefore access is redirected to the 32 bit view of the registry. Writes successful, but the data under the code under the HKLM \ Software \ Wow6432Node 32 code.

    To avoid virtualization, you will need an app manifest. You must use the Required Administrator setting for the requested execution level . Use

    KEY_WOW64_64KEY to specify access to 64 bit view from your 32 bit program

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -