cancel
Showing results for 
Search instead for 
Did you mean: 

DI API - SQL Login failed

Former Member
0 Kudos

I'm a little confused on a DI API program I wrote a month ago. I programmed it to use username "sa" and the relevant password as follows;

oCompany.DbUserName = "sa"

oCompany.DbPassword = "sbo"

Today, when I decided to continue the development, it kept locking up at the oCompany.Connect command.

So, having added myself as a SQL user, I amended the code to oCompany.UseTrusted = True and it started working.

The obvious thing to me was that the sa password has changed, but it hasn't.

Any thoughts?

Accepted Solutions (0)

Answers (1)

Answers (1)

barend_morkel2
Active Contributor
0 Kudos

Dan,

1.Is the SQL Server Security set up as mixed mode? (The authentication must be SQL server and Windows).

2. Your SQL user must be added to the SBO-Common db as well...

Former Member
0 Kudos

Hi Barend,

Thanks for the quick response.

1) It is already set to mixed mode.

2) If I go to SBO Common users, sa is not there. However, as sa is administrator would that make any difference? I tried to add them as a user, but they're not listed on the drop-down.

The thing that confuses me, is that this is something that has changed in the past month. The only thing I can think of is that we are now licensed?

All the best,

Dan

barend_morkel2
Active Contributor
0 Kudos

Dan,

Licensing is not the issue.

Adding the user to SBO-Common is only applicable if its not "sa". Like you said sa is the "main-global" user of the entire DB. Is the DI API on the server on the same patch level as your client machine (this has to be so - if your using SBO 2004 you have to manually upgrade the client machines...)

Former Member
0 Kudos

Yep. We haven't put a patch on yet.

And it works if you change to "Use Trusted".

Former Member
0 Kudos

To clarify, the sa user is set as;

Database owner

Public

Presumably they don't need different rights from this.

barend_morkel2
Active Contributor
0 Kudos

This is a stupid question from my side, BUT are you 100% sure that the company DB you are connecting to has the correct user and password credentials?

Former Member
0 Kudos

Not a stupid question at all!

If I change to "Use Trusted" it connects perfectly, so it must be OK.

I'm not too hot on SQL, but I was under the impression that "Use Trusted" would be using my Windows login?

So I just changed the username to mine and password to mine and it comes up the message as "Failed to connect to SBO-Common".

However, if I try to login as "sa", it just locks up.

Former Member
0 Kudos

Barend,

OK, here's a weird one.

I've just changed the username and password back to sa.

And it now works?!!!!!

I've actually changed nothing at all in my program, nor the settings on SQL. Bizarre!

barend_morkel2
Active Contributor
0 Kudos

Dan,

Could it be that you entered the password in the wrong case? (the db (and SBO) passwords are case sensitive)

Former Member
0 Kudos

Unfortunately not. I'd Rem'd out the lines, and simply took the Rem out again.

Still working this morning. Strange!

All the best,

Dan