Trouble connecting to AS/400 with ASP.NET

A

Amaryllis

Hello,

I am writing an ASP.NET application and trying to connect to an as400
using an ADODB connection. I recently completed a Windows application
that connects to the 400. My code works in the Windows world, so
theoretically, it should work for the ASP application as well. But it
doesn't. I keep getting the error CWBSY1006 - User ID is Invalid. I'm
using my Windows login information to automatically log into the 400,
so a userid and password is not required. It does work, however, if I
hard code my userid and password into the connection string. The
only problem with that is that the users need to log in with their
information for security purposes. Here is my code. Any ideas would
be greatly appreciated.

Thanks,
Amaryllis

AS400.Define("MyAS400")
AS400.Connect(cwbx.cwbcoServiceEnum.cwbcoServiceDataQueues)
conn400 = New ADODB.Connection
conn400.ConnectionString = "Provider=IBMDA400.DataSource.1;" & _
"Data source=MyAS400"
conn400.Open()
 
M

Marina

That is because ASP.NET runs under the ASPNET account. It does not run
under you. So of course, the ASPNET account does not have integrated
security access to your database.

You neither need to give that account rights to the database, or use a
username/password to log in.
 
A

Amaryllis

I agree, but when you add <impersonate=TRUE /> to the web.config
file, it should pick up your information and use it rather than the
ASPNET account information. I've always been able to connect to SQL
Server using that approach. I'm just not sure what is different
about DB2 on the AS/400.

Amaryllis
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top