问题
I am getting Windows API Call Error Code : 0
I have installed SSMS 2018 and was trying to find out if I have any other versions installed. For that I ran sqllocaldb versions
in CMD but got the following message:
Windows API call "RegGetValueW" returned error code: 0.
When I checked manually (via Control Panel), I saw that I have 2015 and 2016 versions installed. So Why it are they not showing in CMD.
I tried to find other solutions but found nothing that made sense to me.
回答1:
This post helped me: https://social.msdn.microsoft.com/Forums/sqlserver/en-US/1257bf26-6ab0-416d-bf26-34f128f42248/sql-2016-sp1-sqllocaldb-versions-errors-with-quotwindows-api-call-quotreggetvaluewquot?forum=sqlexpress
In registry change catalog name in
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server Local DB\Installed Versions
acording to version in
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQLServer\MSSQL13E.LOCALDB\MSSQLServer\CurrentVersion
I my case I had to change from 13.0 to 13.1.
回答2:
This is still an issue sometimes in 2020. daniell89's answer is correct, here is an image further explaining the fix.
来源:https://stackoverflow.com/questions/56760683/windows-api-call-reggetvaluew-returned-error-code-0