SQL sa password and VB 5 Application not working

By jlopez ·
Hello all. I will be as short as possible explaining the issue I am having. We use a VB 5 application to write and retrieve records from a SQL 2000 database. The application was created 10 years ago, and the source code is lost.Now that we are in the testing phase of converting the database to SQL 2008, we get a 'sa' password error when trying to run the VB 5 application. Here is a copy of the error:

Run time error - 2147217843 (80040e4d)
Login failed for user 'sa'

The VB application consists of an executable file and a folder named "controls" which has an ini file with the settings for the connection as follows:


I have changed the server as well as the database, and the VB application works as long as the 'sa' password is empty. I also try to add a couple of lines to the ini file stating the User as 'sa' and the password, but the application gives me the login failed error. I tried other sa and password lines from without luck.

Any ideas?

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Collapse -

Can you try a different user?

by Slayer_ In reply to SQL sa password and VB 5 ...

Maybe make a different user and use that?

Collapse -

Reponse To Answer

by jlopez In reply to Can you try a different u ...

Thanks Slayer. I already tried a different user, same result. The VB application has the user sa somewhere without a password, and I have not been able to find it. I even used a VB decompiler to see the code, but I could not locate 'sa' anywhere.

Collapse -

You can also try setting up to use ODBC

by Slayer_ In reply to SQL sa password and VB 5 ...

Set your connection string to use an ODBC setting and use ODBC to set the login password.

A note about this though, Windows has a 32 and 64 bit registry, so you need to run the 32bit version of the ODBC configuration tool for a VB5 app to work.
This is located here:
C:\Windows\System32\odbcad32.exe (not SysWOW64)

Collapse -

A few things to check

by Tony Hopkinson In reply to SQL sa password and VB 5 ...

Can you connect to the database from that PC as sa? Set up a DSN and hit test connection for a quick try.
If you upgraded the db to 2008, did you follow the entire procedure? One of the last steps is to set the compatibility level, if you omit that all sorts of weirdness springs up.
SQL2008 shouldn't let you have a blank password, certainly not for sa...
Rules for strong should apply.
Unlikely, but you didn't have a few goes and end up with the account locked out did you?
And as Slayer suggested, if you can configure the program to use an other user, it's worth a go, bit of a head scratcher why an application would need that level of access anyway.

Collapse -

Reponse To Answer

by jlopez In reply to A few things to check

Thanks Tony. I am able to connect to the database using an ODBC connection and the sa user and password, however, the application has the user 'sa' with a blank password either within the VB code or in the configuration file. Like I replied to Slayer, I decompiled the application, but could not find the connection string anywhere within what I was able to decompile.

Collapse -

Sounds like you are stuck then

by Slayer_ In reply to SQL sa password and VB 5 ...

Related Discussions

Related Forums