By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,078 Members | 1,733 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,078 IT Pros & Developers. It's quick & easy.

ADODB connection with SQL2000SP3

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.