> > Good day to you,
> >
> > I have a SQL server that I am trying to connect to using this connection string.
> >
> > SQLSTRINGCONNECT("Driver=SQL Server;Server=MPISWEB01\MPIORG;Database=Maximo52;Trusted_Connection=Yes")
> >
> > I have written an application that, when run as a network administrator equivalent, will connect to SQL server no problem. When the application is run as a regular user, I get a connectivity error to SQL server, specifically from the SQLStringConnect function
> >
> > When I do an aerror() to get the error message, I am given the following:
> > Connectivity error: [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'MPI\Itszero'.
> >
> >
> > MPI is my windows domain, and Itszero is the user I was logged into the network with
> >
> >
> >
> > So I changed the connection string and got rid of the trusted connection, and made one with Authentication, and I typed in the username and password.
> >
> > "Driver=SQL Server;Server=MPISWEB01\MPIORG;Database=Maximo52;uid =;pwd = "
> >
> > After changing the connection string I keep getting the same error. It's like SQL Server doesn't care that I am providing SQL authentication to it, it continues to use windows authentication. My server is set to allow both windows and SQL authentication.
> >
> >
> > Anyone have any solutions for this, or an idea on a path forward. possibly missing network rights?
> >
> >
> > Thanks in advance,
> >
> > Travis Pick
>
> 1. You should allow to SQL Server to use BOTH modes: Windows Authentication and SQL Server one.
> 2. In your connection string you should set VALID username and password that is defined in SQL Server:
> "Driver=SQL Server;Server=MPISWEB01\MPIORG;Database=Maximo52;uid=sa (or whatever login you have on SQL Server);pwd=password(the exact password defined for this login)"
>
> Also, be very careful with spaces in connection string, some ODBC drivers (SQL Server is one of them) doesn't like to have spaces before and after the equal sign.
> i.e. you can get error with this:
> "Driver=SQL Server;Server=MPISWEB01\MPIORG;Database=Maximo52;uid = sa;pwd = pwd"
> (assuming that sa and pwd are valid for SQL Server login)
> but not for this:
> "Driver=SQL Server;Server=MPISWEB01\MPIORG;Database=Maximo52;uid=sa;pwd=pwd"
>
>
> -----------------
> Borislav Borissov
>
> Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
> The only thing normal about database guys is their tables.
Borislav, thanks for the reply. You are exactly correct, it was the spacing that I had between uid = user; pwd = password.
My SQL server is set for both windows and sql server authentication. I guess what happens is when the connection string doesn't provide valid info for SQL authentication, windows authentication takes over and attempts to use the username.
My connection is working fine now. Thanks