In your first example, OleDbConnection conn = new OleDbConnection(@"Provider=SQLOLEDB;User ID=sa;Initial Catalog=master;Data Source=(local);");, you didn't provide a password for the 'sa' account. But in your statement about how you installed MSDE, you said that you set the password to 'sa'. So, for this connection string, you should add Password=sa;. However, it is recommended that you not use a system administrator account to connect to the database from an application. In your second example, you are using integrated security, which means that the connection is made to the database using the currently active Windows login. I assume from the username in the error message, and your statement that it's the machine name, that you're writing a service, and it's set up to run using the system account. This would work, but you'll have to use a tool (or write an app) to configure the database server to allow this account to login, and give it access to the specific database that it needs to access. Note that since you set Integrated Security=SSPI;, the User Id=sa; part of the connection string is ignored.
Grim
(aka Toby)
MCDBA, MCSD, MCP+SB
Need a Second Life?[^]