Greetings all!

I'm working on changing SQL authentication to Windows authentication for some legacy code.

I have this code working with with SSPI for the most part, but I'm grappling with this authentication issue:

Before the main part of my code starts, I have a part that uses a service account that logs into the SQL server with SQL authentication. I'm trying to figure out how to impersonate this user for this part, so that I can use SSPI and not SQL authentication. I've been looking at using LogonUser in advapi32.dll to impersonate this user (which does have an account on my domain), but it's my understanding that whomever would use this application would also need SE_TCB_NAME (Act as part of the operating system) permissions in order to use the LogonUser function (re: http://support.microsoft.com/kb/285879). This is certainly too much permission to give several users for this functionality.

Is there a way to impersonate this service account in VB6 so that I can run some SQL under this account using windows authentication/SSPI?