Problem accessing MSDE2000 database from VB program on Win98 machine


I have a VB program that connects to a MSDE database using ADO.
The program uses ADO 2.8

This program works perfectly in Win XP.
But on Win 98, I get this error:

Runtime error '-2147467259 (80004005)':

Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection"

I am sure there are no problems in the connection string, coz the same works in XP.

Please help.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

are you trying to use windows authentication? This may be the problem. Try using Mixed Mode authentication and change your string to pass a SQL Login with it's password. I don't believe you can use the WIndows Authentication coming from a 98 box.
rajesh_khaterAuthor Commented:
I am passing the SQL login 'sa' and no password.
well according to the error message it sounds like you are not passing a username at all, and trying to use windows authentication which won't work.

Double check your connection string. It probably works on XP because the account you are using has permissions on the SQL box. In Windows 98 you can't use Windows authentication. You also should not have a null SA password, a lot of exploits can happen that way.
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

rajesh_khaterAuthor Commented:
I am absolutely sure about the connection string.
Here it is:

"Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;User ID=sa;Initial Catalog=MyDatabase;Data Source=Machine1\Test"

Yes, the error message seems to be indicating that I am not passing the username, whereas it is not the case.
well that connection string is using Integrated Security. That is windows authentication. You are right to use that so you don'thave to store the password if you are on a box that supports Windows Authentication. Windows 98 doesn't.. You need to not use Integrated Security, and pass your sa user with your sa password.

Do you have a password for SA on the server?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
So you will need to change the connection string. This works on the XP box because you are probably logged on to the domain and are authenticated. You are not connecting as SA there most likely but are actually connecting as the user you are logged on as.

scroll down and read the paragraph describing integrated security.
rajesh_khaterAuthor Commented:
no I dont have password for sa.

That is not a concern again. The database server is on a network with only 2 computers and not connected to internet.

How do I not use Integrated Security ?
Whats the connection string for that ?
I am not a programmer but I believe it is just this
Provider=sqloledb;Data Source=Aron1;Initial Catalog=pubs;User Id=sa;Password=;"
just change what is native to your connection.

This site has a bunch of connection strings easy to get at:

Also yes SA password is a concern. It does not matter if it is attached to the internet. Security is security. The SA account shouldn't even be used. You should create a separate account for use. SA has the complete keys to the kingdom. If someone works at this client and wants to teachthemselves sql and they play around with the insecure SA account, they can potentially destroy the clients setup, corrupt databases and make your life miserable when you have to explain to the client why you lef the most important password on their server blank. Make a password and make your life easier in the long run. Being off the internet lowers some risk but there stills exists plenty of risk...
rajesh_khaterAuthor Commented:
Thnx Mike.

You have been of great help. I will close most of these questions I have asked after a visit to the client's place if things work out.

I just posted one more question:
rajesh_khaterAuthor Commented:
Thnx. Just removing "Integrated Security=SSPI" from the connection string worked.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.