473,511 Members | 14,825 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ADODB connection with SQL2000SP3

my code is using ADODB connection to connect to SQL (Virtual) Server.

the way it being done is (c++):

ADODB::_ConnectionPtr m_dbConn;
ADODB::_RecordsetPtr m_dbRst;
m_dbConn.CreateInstance(__uuidof(ADODB::Connection ));
m_dbRst.CreateInstance( __uuidof( ADODB::Recordset ));
m_dbConn->ConnectionString=( L"DSN=mydsn" );
m_dbConn->Open("","sa","",-1);

lately after installing SP3 over SQL2000, it was impossible to connect
- the error message showed: login failed for user 'null)'. reason: not
associated with a trusted sql server connection.

so i changed the connection string to:
m_dbConn-> ConnectionString =(L"DSN=mydsn; UID=sa; PWD=;");
m_dbConn->Open("","","",-1);

and now it works !!

what is the reason for that ?
what in sql SP3 interrupt for this kind of connection ?
what is the difference ?

Jul 23 '05 #1
1 3518
liorh (li*****@gmail.com) writes:
my code is using ADODB connection to connect to SQL (Virtual) Server.

the way it being done is (c++):

ADODB::_ConnectionPtr m_dbConn;
ADODB::_RecordsetPtr m_dbRst;
m_dbConn.CreateInstance(__uuidof(ADODB::Connection ));
m_dbRst.CreateInstance( __uuidof( ADODB::Recordset ));
m_dbConn->ConnectionString=( L"DSN=mydsn" );
m_dbConn->Open("","sa","",-1);

lately after installing SP3 over SQL2000, it was impossible to connect
- the error message showed: login failed for user 'null)'. reason: not
associated with a trusted sql server connection.

so i changed the connection string to:
m_dbConn-> ConnectionString =(L"DSN=mydsn; UID=sa; PWD=;");
m_dbConn->Open("","","",-1);

and now it works !!

what is the reason for that ?
what in sql SP3 interrupt for this kind of connection ?
what is the difference ?


Since I don't know what is in that DSN, I would have to guess a bit.
Then again, I never liked DSNs. Anyway, my guess is that since SP3
was very focused on security, it may be that since you did not provide
a password, there is now a default for Windows authentication.

Anyway, running a system with a blank password for 'sa' is extremely
poor practice. So is it for that matter, to use sa to connect to SQL
Server from an application.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
7745
by: Patrick | last post by:
I understand that with IIS5.1 on Windows XP Professional SP1, I can 1) Either set under IIS Manager-> Any specific Virtual Directory-> Configuration->Options->ASP Script timeout for all pages...
0
2466
by: Channing Jones | last post by:
Hello everyone, I am trying to store data in a binary field of an SQL-Server table using ADODB. So far, I have managed to store a record but not any data in the binary field. I only get...
5
29791
by: Simone | last post by:
Hello I hope you guys can help me. I am very new to ADO... I am creating a ADODB connection in a module and trying to access it from a command button in a form. Function fxEIDAssgn(plngEID As...
0
3248
by: Andre Azevedo | last post by:
Hi all ! I've created a .net serviced component with only one method. This method receive an ADODB.Command object and execute it. The ADODB.Command object is created in the client process. (VB...
0
3519
by: ASP.Confused | last post by:
The old message looked a little stale, so I am re-posting it here. Anybody have any ideas of what I could do?!? The previous responses to this question are below. If you want to look at the...
4
5496
by: Ames111 | last post by:
Hi I have an application that connects to a SQl database on my computer via an ADODB connection: ADODB.Connection Conn = new ADODB.Connection(); Conn.ConnectionString = ("Driver={SQL...
0
1708
by: dmckenna | last post by:
I've been tasked to upgrade an old system and there's many different versions of VB code that uses MDAC to talk to MSSql. Do you know what the difference is between the two code versions? Is there...
4
4258
by: T | last post by:
-------------------------------------------------------------------------------- I tried this audit trail code, using 2003 and it works great, I try and use it at work w/97 and it blows up:...
2
6718
EYE4U
by: EYE4U | last post by:
Hi all, This is how you can connect to an Access Database using ADODB.. First add a reference to Microsoft ActiveX Data Objects 2.0 Library Now to lets Declare some variables : Private Con...
0
7153
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7371
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7432
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7093
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7517
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5077
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4743
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1583
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
452
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.