Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ODBC errors

Status
Not open for further replies.

ccampbell

Programmer
Joined
Aug 16, 2001
Messages
201
Location
US
I have written a program that creates a database connection. When it goes to create the connection I get the error:
Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.
State:28000,Native:18456,Origin:[Microsoft][ODBC SQL Server Driver][SQL Server]

I have checked, and the password and userID and address are all correct. Is there any other reason that I would get this error? Thanks.
 
Can you include the code from your program, it looks like it's not successfully passing the username and password
 
CDatabase m_db;
m_db.SetQueryTimeout((DWORD)180); //timeout in 3 minutes

try
{
m_db.OpenEx("DSN=Screening",CDatabase::openReadOnly | CDatabase::noOdbcDialog);
}
catch( CDBException *e)
{
TCHAR szErr[1024];
if (e->GetErrorMessage(szErr, 1024))
{
logFile << _T(&quot;The following errors prevented the database connection: &quot;)
<< endl
<< e->m_strError;
logFile << e->m_strStateNativeOrigin;
e->Delete();
}
Beep(2000,1000);
}

The ODBC connection and the connection to the database both just use windows authentication. There is no user name and password to send to them. That is why I can't understand this error.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top