When I do not include SQLServerUniProvider in my uses, I am given an error stating that "You should add the SQLServerUniProvider unit to the uses clause of any unit..."
When I add SQLServerUniProvider in my uses, my service attempts to start, then immediately errors out and says "OLE DB Error occured. Code 800401F0h. CoInitialize has not been called." This error is triggered when I try to set Connected := True during a database connection attempt. This is my example, in which I see the log message "I made it this far!" only to have it error out on the next line.
Code: Select all
Connected := False;
Server := dbConfig.Server;
Database := dbConfig.Database;
Username := dbConfig.UserID;
Password := dbConfig.Password;
ProviderName := 'SQL Server';
logger.Log('I made it this far!');
Connected := True;
logger.Log('I did not make it this far!');