Solved

How to connect to AS400(JDEdwards) from an asp.net application......

Posted on 2004-04-19
8
1,451 Views
Last Modified: 2010-05-18
Hi,

I need to connect to AS400 from my asp.net application.  Can anyone has any ideas/suggestions?
Code examples are appreciated.

Thanx
cm
0
Comment
Question by:chandukb
  • 4
  • 3
8 Comments
 
LVL 11

Expert Comment

by:Slimshaneey
ID: 10859503
To connect to a database or the file sytem or what???
0
 

Accepted Solution

by:
wendelina earned 125 total points
ID: 10860715
Assuming you're attempting to retreive data from a file, you can treat the AS400 like it's a database.

I don't know if this is the only way, or even the best way, but this is how I've done it.

Install IBM Client Access on your ASP server. (You really only need the Client Access ODBC Driver (32-bit) driver installed, but this is the easiest way to go about it.)

Create an System DSN ODBC connection to your AS400.

---------------------------------------------------------------
Under the tab: General
    Data source name: Give the ODBC connection a name. You will use this in ASP as your DSN.
    System: Enter the IP or name of your AS400.

Under the tab: Server
    Naming Convention: Choose - SQL Naming Convention (*SQL)
    SQL Default Library: Type the name of the library in which the file resides (I had to ask our AS400 operators)
    Connection Type: I chose "Read-Only", since we do not update our 400 from the web.

Under the tab: Packages
     Enable extended dynamic (package) support: Uncheck this option (I've been told it's faster ???)

Under the tab: Performance
     Enable lazy close support: Check (Another mystery ???)
     Uncheck all others

Under the tab: Language
     Sort Type: Sort based on HEX values (??)

Under the tab: Catalog
     OS/400 Library view: Default library list (?)
     Object Description Type: OS/400 Object Description
     Enable Search Patterns: Check

Under the tab: Translation
     Convert binary data...: Check

Under the tab: Diagnostic
     Uncheck all
---------------------------------------------------------------

Your connection will look something like this:

---------------------------------------------------------------
Dim objConn
set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionTimeout = 1000
objConn.CommandTimeout = 1000

objConn.Open "ODBC Name",Request.QueryString("username"),Request.QueryString("password")
      
if Err.number <> 0 then
     'If the error is with a bad username/password return and error code of 1
     if Err.number = -2147217843 or Err.number = -2147467259 then
          Response.Write("<font class=""error"">You entered an invalid User Id and Password combination.</font><br /><br />")

          objConn.Close
          set objConn = nothing
     end if
else
     allowUserOnAS400()
end if
---------------------------------------------------------------

I recommend using the Err.number code. It will check to see if the user is valid on the system. I actually do this part first. If it verifies, THEN let them into the 400 to access the data. (The error codes may vary from system to system... I really don't know. If the above fails, simply output the error codes you receive and try anything you can to break the login to get all codes.)

I hope that helps.
0
 

Expert Comment

by:wendelina
ID: 10860736
Sorry, I forgot to mention. I'm doing this in Classic ASP. I don't think there'd be much of a difference, but my experience with .NET has been limited.
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 2

Author Comment

by:chandukb
ID: 10869344
wendelina,

Where can I find Client Access ODBC Driver, I checked on IBM site, but couldn't find it.  Do you have any links?  

Thank You for your help.

cm
0
 
LVL 2

Author Comment

by:chandukb
ID: 10869567
Can I use OLEDB to connect to AS400.  I found some info about IBMDA400, where can I find this oledb driver.  I think if I use oledb driver, I do not have to create dsn using odbc driver, am I right.  Please comment.  

cm
0
 
LVL 2

Author Comment

by:chandukb
ID: 10870642
How about .net provider, is there any .net provider available?

cm
0
 

Expert Comment

by:wendelina
ID: 11222360
Sorry I didn't respond to this sooner.

Beyond "Client Access Express" (now known as "iSeries Access"), I'm not familiar with any other drivers or ways to connect. I was actually kinda lucky I came across the ODBC solution. As you probably know pretty well, there really isn't that much out there about connecting to a 400 from the web.
0
 
LVL 2

Author Comment

by:chandukb
ID: 11223729
Hi,

I am coding my ASP.NET app using iSeries .Net provider beta from IBM.  I will let you know after I am done testing.

Thanks
cm
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

816 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now