Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 139
  • Last Modified:

Problem accessing MSDE2000 database from VB program on Win98 machine

Hi,

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.
0
rajesh_khater
Asked:
rajesh_khater
  • 6
  • 5
1 Solution
 
MikeWalshCommented:
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.
0
 
rajesh_khaterAuthor Commented:
I am passing the SQL login 'sa' and no password.
0
 
MikeWalshCommented:
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.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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.
0
 
MikeWalshCommented:
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?
0
 
MikeWalshCommented:
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.
0
 
MikeWalshCommented:
http://www.governmentsecurity.org/articles/MicrosoftDatabaseSecurity.php

scroll down and read the paragraph describing integrated security.
0
 
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 ?
0
 
MikeWalshCommented:
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:
http://www.connectionstrings.com/

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...
0
 
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:

http://www.experts-exchange.com/Databases/Microsoft_SQL_Server/Q_21797984.html
0
 
rajesh_khaterAuthor Commented:
Thnx. Just removing "Integrated Security=SSPI" from the connection string worked.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 6
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now