AnsweredAssumed Answered

PI OLEDB - VBA Error, Unable to Connect from Excel

Question asked by cbartman on Sep 17, 2020
Latest reply on Sep 22, 2020 by cbartman

I have an Excel workbook that queries PI OLEDB by creating an ADODB connection and opening an ADODB recordset in VBA.


The code used to work fine for several months, but for some reason has recently stopped working and I am getting an error message, shown below, that I haven't been able to resolve:

Run-time error '-2147467259 (80004005)':
[PI SDK] Failed to update server information in the registry for server SERVERNAMEHERE


Here is the VBA code with the connection string for opening the connection.  The VBA error is encountered at Conn.Open :


Dim Conn As New ADODB.Connection
sConn = "Provider=PIOLEDB;Data Source=SERVERNAMEHERE;Initial Catalog=piarchive;Integrated Security=SSPI"

Conn.Open sConn ' VBA now fails here, when attempting to open connection


I have tried a few things with different connection strings such as connecting without SSPI, and have verified the server name has not changed.


What is interesting is that I have no issues connecting or querying with the PI OLEDB Tester tool 'PIOLEDBTester.exe'


I have also tried running Excel with an Administrator role in hopes that it would resolve any issues writing to the registry as the error message suggests.


I have performed a MS Office repair, and have also uninstalled and reinstalled PI OLEDB and PI SDK. 


I also ran the code with logging enabled with Log Level = 3 and got the output below, which doesn't tell me enough to be able to identify the issue.


TimeMessage TypeApplicationPIDIDTIDObjectInterfaceMethodMessage
2020-09-15 11:29PROVIDER_INITEXCEL2552817644Data SourceIDBInitializeInitializeUser ID = ""; Initial Catalog = "piarchive"; Data Source = "SERVERNAMEHERE"; Window Handle = "0"; Prompt = "4"; Extended Properties = ""; Connect Timeout = "15"; Integrated Security = "SSPI"; Command Timeout = "300"; Log Level = "3"; Log File = "C:\Temp\PIOLEDB\PIOLEDB.log"; Shorten Primary Keys = "0"; Always Return Rowset = "0"; Defer Execution = "0"; Identifier Prefixes = "0"; Disable Server Selection = "0"; Time as Double = "0"; Optimization Log Limit = "100"; Session ID = "1"; Keep Default Ordering = "-1"; Session Pipelines = "1"; Current Time Precision = "0"; Function Errors as NULL = "-1"; Cancel On Low Resources = "-1"; Show Hidden Metadata = "0"; Schema Name = ""; Default Timestep = "1D"; Integers as Value = "0"; Timestamp Interval Start = "0"; Support PI Wildcards = "-1"; Time Zone = "Local"; Sync Calls = "0"; Connection Type = "PreferPrimary"; Max Cache Size = "100000"; Server Log = ""; 
2020-09-15 11:29ERROR_RECORDEXCEL2552817644Data SourceIDBInitializeInitializeE_FAIL - [PI SDK] Failed to update server information in the registry for server SERVERNAMEHERE
2020-09-15 11:29INTERFACE_ERROREXCEL2552817644Data SourceIDBInitializeInitializeE_FAIL


Here are the versions of the server, PI OLEDB and PI SDK am working with. 

VersionOSOS Version
PI Server3.4.395.64Windows NT AMD646.2.9200
PI OLEDB Provider3.4.2.17Windows 1010.0.18362.329
PI SDK1.4.7.516Windows 1010.0.18362.329


I'm hoping someone may have some ideas as to why I am having this issue, or if there is a specific registry key that I should check.  Thanks in advance!