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

x
?
Solved

More problems connecting to SQL2000 via ADO / VB6

Posted on 2005-04-26
10
Medium Priority
?
212 Views
Last Modified: 2008-02-26
I have developed a small application that connects to a SQL server and it seems to work fine on most machines. We are using mixed security on the SQL server and i have never encountered this issue before. On this one particular machine i receive the "-2147217843 (80040e4d) Login Failed for user sa" error message when starting the app with the following connection strings (i have tried all three). Any ideas?

1. cnnDXK.Open "Provider=SQLOLEDB.1;Password=<password>;Persist Security Info=True;SERVER=persephone\persephone;Initial Catalog=dtkpro;User Id=sa; "

2. cnnDXK.Open "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;SERVER=persephone\persephone;Initial Catalog=dtkpro;User Id=sa;Password=<password>; "

3. cnnDXK.Open "Provider=sqloledb;SERVER=persephone\persephone;Initial Catalog=dtkpro;User Id=sa;Password=<password>; "

I am able to connect to the SQL server via ODBC DataSource using the sa login or trusted security without any issue.

Any ideas would be appreciated. Thanks.

0
Comment
Question by:james_ford_dsi
10 Comments
 
LVL 11

Expert Comment

by:Jokra_the_Barbarian
ID: 13870616
Maybe something to do with the version of MDAC on the client machine?
0
 

Author Comment

by:james_ford_dsi
ID: 13870621
I have updated the MDAC to 2.8 but that did not help either.
0
 
LVL 28

Expert Comment

by:rafrancisco
ID: 13870665
How did you update the MDAC?  Were you able to verify that the file is really version 2.8 because based on my experience updating MDAC, it doesn't get updated that easily because it is in use.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 13870896
Unless you have a SQL Server instance name called "persephone", than you would be using the default instance, in other words:

cnnDXK.Open "Provider=SQLOLEDB.1;Password=<password>;Data Source=persephone;Initial Catalog=dtkpro;User Id=sa; "
0
 

Author Comment

by:james_ford_dsi
ID: 13871135
rafransisco, thanks, i will look at the mdac file versions.

acperkins, yes we are using an instance of SQL called the same. It's a long story.
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 13871273
Fair enough. Notice that I also changed "Server" to "Data Source"
0
 

Author Comment

by:james_ford_dsi
ID: 13873425
I prefer to connect specifying the server and database so that i don't have to maintain a DSN entry. Is there a downside to this method?
0
 

Author Comment

by:james_ford_dsi
ID: 13873428
rafransisco, i had our systems administrator re-install MDAC and check the versions but we're still encountering the same message.
0
 

Author Comment

by:james_ford_dsi
ID: 13875969
Well check this out folks. I got it to work by changing the server name to the ip address. For some reason the system cannot see the instance of the SQL server when it has the same name as the server. I changed persephone\persephone to 192.168.1.5\persephone in the app and the accompanying database file and it works like a charm. We are going to look at our network configuration to see what might be causing the name recognition issue. Thanks for the feedback.

Forum administrator, please close this conversation. Thank you.
0
 
LVL 75

Accepted Solution

by:
Anthony Perkins earned 500 total points
ID: 13876775
>>I prefer to connect specifying the server and database so that i don't have to maintain a DSN entry. Is there a downside to this method?<<
You are missing the point, I am not using DSN, the correct connection string uses "Data Store" not "Server".  If you do use Server as in:
Provider=SQLOLEDB.1;Password=<password>;Persist Security Info=True;SERVER=persephone\persephone;Initial Catalog=dtkpro;User Id=sa;

It will change it after you do the Open method to something like this (try it yourself):
Provider=SQLOLEDB.1;Password=<Password>;Persist Security Info=True;User ID=sa;Initial Catalog=dtkpro;Extended Properties="Server=persephone\persephone"

>>Forum administrator, please close this conversation. Thank you.<<
This is the way it works here:
I answered my question myself. What do I do?
http://www.experts-exchange.com/Web/Web_Languages/ASP/help.jsp#hi70
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have a large data set and a SSIS package. How can I load this file in multi threading?
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Suggested Courses

579 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question