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.cwbcoServiceDa taQueues)
conn400 = New ADODB.Connection
conn400.ConnectionString = "Provider=IBMDA400.DataSource.1;" & _
"Data source=MyAS400"
conn400.Open()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.
"Amaryllis" <amy_hankins@.swn-dot-com.no-spam.invalid> wrote in message
news:410fe1bf$1_5@.Usenet.com...
> 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.cwbcoServiceDa taQueues)
> conn400 = New ADODB.Connection
> conn400.ConnectionString = "Provider=IBMDA400.DataSource.1;" & _
> "Data source=MyAS400"
> conn400.Open()
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
0 comments:
Post a Comment