Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 19-05-2009
Member
 
Join Date: Apr 2009
Posts: 22
Connecting to AS400

I want to connect my Asp.Net C# Application to a AS/400 database. When i try to connect database it gives me an error message : Microsoft OLE DB Provider for ODBC Drivers (0x80040E4D)[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.Does anyone know what causes this issue and how to fix it?Any help will be extremely appreciated.
Reply With Quote
  #2  
Old 19-05-2009
Member
 
Join Date: Dec 2008
Posts: 177
Re: Connecting to AS400

Make sure to include the Trusted_Connection=yes connection string parameter in the ADO connection string. If you do not include this parameter, the above-mentioned error occurs even if the Windows NT/Windows 2000 user account that is used to process the request for the ASP page has a corresponding Windows authentication login in SQL Server.

Make sure to specify the UID and the PWD connection string parameters if you want to use standard SQL Server authentication to establish a database connection. You must specify these parameters even if the configuration properties of the DSN are set to use standard SQL Server authentication. If you fail to specify these parameters, IIS tries to open a trusted connection to the database.
Reply With Quote
  #3  
Old 19-05-2009
Member
 
Join Date: May 2008
Posts: 2,293
Re: Connecting to AS400

Check this thread with similar issue : Error Microsoft OLE DB Provider for ODBC Drivers


Try this instead:

oConn.Open "Provider=sqloledb;" & _

"Data Source=myServerName;" & _

"Initial Catalog=myDatabaseName;" & _

"User Id=myUsername;" & _

"Password=myPassword"
Reply With Quote
  #4  
Old 19-05-2009
Member
 
Join Date: May 2008
Posts: 2,008
Re: Connecting to AS400

To use standard SQL Server authentication to establish a connection, it is essential that you configure the security settings on the target SQL Server to permit Mixed mode (NT and SQL Server) authentication. If you specify a valid UID and omit the PWD parameter in the connection string, when the specified User ID contains a non-blank password, you receive the following error
Quote:
message:Microsoft OLE DB Provider for ODBC Drivers (0x80040E4D)
[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user <SQL Server User Id specified in the connection string>.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Connecting to AS400"
Thread Thread Starter Forum Replies Last Post
Import AS400 formated text into InDesign? Braasch Windows Software 3 16-07-2010 04:38 PM
Connecting my Wii to my PC Savannah87 Video Games 5 25-04-2010 03:02 AM
Access queries on AS400 Ujagar Software Development 5 13-02-2010 09:23 AM
Connecting PSP to Via PS3 Brian z. Networking & Security 2 30-08-2008 06:34 PM


All times are GMT +5.5. The time now is 02:51 PM.