473,326 Members | 2,102 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Connecting to an AS/400 - Connection Issue with code

Hi All,

I almost have the connection working for my connection to the AS/400 from an
ASP page. However, I have an error appearing, and I'm not sure how to fix
it. The code I have for connecting to the AS/400 is this:

<%
Set adoCon = Server.CreateObject("ADODB.Connection")
adoCon.Open "Provider=IBMDA400.DataSource.1;Persist Security
Info=False;User ID=XXXX;Password=XXXX;Data Source=192.168.0.20;Catalog
Library List=SPSL/SST32"
Set rsNINJA = Server.CreateObject("ADODB.Recordset")
SQL_query = "SELECT * FROM SPSL_SST32 where otsddt = '20041012' and
otdrvr='sandy'"
rsNINJA.open SQL_query, objConn, adOpenStatic, adLockReadOnly
intTotalColumns = RS.Fields.Count - 1
%>

However, when I execute the code, I get this:

ADODB.Recordset error '800a0bb9'
Arguments are of the wrong type, are out of acceptable range, or are in
conflict with one another.

/ninja/showstatus.asp, line 15

Line 15 in this case is the line that states "rsNINJA.open SQL_query,
objConn, adOpenStatic, adLockReadOnly".

If anyone could give me some ideas on what I need to fix here, I'd be
eternally grateful.

I know it is connecting, because if I change the password to a bad password,
I'll get an error stating the password is incorrect.

Thank you!

Brian.
Jul 21 '05 #1
5 4944
I think you need to changes objConn to adoCon.

rsNINJA.open SQL_query, adoCon, adOpenStatic, adLockReadOnly
"Brian Piotrowski" <bp*********@NOSPAM.simcoeparts.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Hi All,

I almost have the connection working for my connection to the AS/400 from an ASP page. However, I have an error appearing, and I'm not sure how to fix
it. The code I have for connecting to the AS/400 is this:

<%
Set adoCon = Server.CreateObject("ADODB.Connection")
adoCon.Open "Provider=IBMDA400.DataSource.1;Persist Security
Info=False;User ID=XXXX;Password=XXXX;Data Source=192.168.0.20;Catalog
Library List=SPSL/SST32"
Set rsNINJA = Server.CreateObject("ADODB.Recordset")
SQL_query = "SELECT * FROM SPSL_SST32 where otsddt = '20041012' and
otdrvr='sandy'"
rsNINJA.open SQL_query, objConn, adOpenStatic, adLockReadOnly
intTotalColumns = RS.Fields.Count - 1
%>

However, when I execute the code, I get this:

ADODB.Recordset error '800a0bb9'
Arguments are of the wrong type, are out of acceptable range, or are in
conflict with one another.

/ninja/showstatus.asp, line 15

Line 15 in this case is the line that states "rsNINJA.open SQL_query,
objConn, adOpenStatic, adLockReadOnly".

If anyone could give me some ideas on what I need to fix here, I'd be
eternally grateful.

I know it is connecting, because if I change the password to a bad password, I'll get an error stating the password is incorrect.

Thank you!

Brian.

Jul 21 '05 #2
I saw that after I posted the message, and I changed it. It still didn't
seem to make a difference.

However, I removed "adOpenStatic, adLockReadOnly" from the statement, and
now I get a new error:

IBMDA400 Command error '80004005'
SQL0204: SPSL_SST32 in SYSOPR type *FILE not found. Cause . . . . . :
SPSL_SST32 in SYSOPR type *FILE was not found. If this is an ALTER TABLE
statement and the type is *N, a constraint was not found. If this is not an
ALTER TABLE statement and the type is *N, a function, procedure, or trigger
was not found. Recovery . . . : Change the name and try the request again.
If the object is a node group, ensure that the DB2 Multisystem product is
installed on your system and create a nodegroup with the CRTNODGRP CL
command.

/ninja/showstatus.asp, line 15

It says that it can't find the file. If that is the case, then where should
my file be located in order for this statement to find it? On our AS/400,
the file is in SPSL/SST32.

Thanks,

Brian.

"SyrOrange" <do************@netzero.net> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
I think you need to changes objConn to adoCon.

rsNINJA.open SQL_query, adoCon, adOpenStatic, adLockReadOnly
"Brian Piotrowski" <bp*********@NOSPAM.simcoeparts.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Hi All,

I almost have the connection working for my connection to the AS/400 from
an
ASP page. However, I have an error appearing, and I'm not sure how to

fix it. The code I have for connecting to the AS/400 is this:

<%
Set adoCon = Server.CreateObject("ADODB.Connection")
adoCon.Open "Provider=IBMDA400.DataSource.1;Persist Security
Info=False;User ID=XXXX;Password=XXXX;Data Source=192.168.0.20;Catalog
Library List=SPSL/SST32"
Set rsNINJA = Server.CreateObject("ADODB.Recordset")
SQL_query = "SELECT * FROM SPSL_SST32 where otsddt = '20041012' and
otdrvr='sandy'"
rsNINJA.open SQL_query, objConn, adOpenStatic, adLockReadOnly
intTotalColumns = RS.Fields.Count - 1
%>

However, when I execute the code, I get this:

ADODB.Recordset error '800a0bb9'
Arguments are of the wrong type, are out of acceptable range, or are in
conflict with one another.

/ninja/showstatus.asp, line 15

Line 15 in this case is the line that states "rsNINJA.open SQL_query,
objConn, adOpenStatic, adLockReadOnly".

If anyone could give me some ideas on what I need to fix here, I'd be
eternally grateful.

I know it is connecting, because if I change the password to a bad

password,
I'll get an error stating the password is incorrect.

Thank you!

Brian.


Jul 21 '05 #3
I don't really think this is the correct answer, but for me, I've found that
I cumbersomely always have to fully qualify the fields I'm querying even
when specifying the library list in the connection string.

SELECT Library.Member.Field FROM Library.Member...

Or maybe it was just

SELECT Field FROM Library.Member

So, try:

Library--------|
Member---------|-----|
Field----------|-----|--------|
| | |
SELECT * FROM SPSL.SST32.SPSL_SST32

(Is your field name really SPSL_SST32?)

Ray at work

"Brian Piotrowski" <bp*********@NOSPAM.simcoeparts.com> wrote in message
news:ef*************@TK2MSFTNGP15.phx.gbl...
I saw that after I posted the message, and I changed it. It still didn't
seem to make a difference.

However, I removed "adOpenStatic, adLockReadOnly" from the statement, and
now I get a new error:

IBMDA400 Command error '80004005'
SQL0204: SPSL_SST32 in SYSOPR type *FILE not found. Cause . . . . . :
SPSL_SST32 in SYSOPR type *FILE was not found. If this is an ALTER TABLE
statement and the type is *N, a constraint was not found. If this is not
an
ALTER TABLE statement and the type is *N, a function, procedure, or
trigger
was not found. Recovery . . . : Change the name and try the request again.
If the object is a node group, ensure that the DB2 Multisystem product is
installed on your system and create a nodegroup with the CRTNODGRP CL
command.

/ninja/showstatus.asp, line 15

It says that it can't find the file. If that is the case, then where
should
my file be located in order for this statement to find it? On our AS/400,
the file is in SPSL/SST32.

Thanks,


Jul 21 '05 #4
Got it! It was the underscore that was throwing my data off. When I
changed from SPSL_SST32 to SPSL.SST32 it worked!

Thanks so much Ray!

Brian.

"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:OA**************@TK2MSFTNGP12.phx.gbl...
I don't really think this is the correct answer, but for me, I've found that I cumbersomely always have to fully qualify the fields I'm querying even
when specifying the library list in the connection string.

SELECT Library.Member.Field FROM Library.Member...

Or maybe it was just

SELECT Field FROM Library.Member

So, try:

Library--------|
Member---------|-----|
Field----------|-----|--------|
| | |
SELECT * FROM SPSL.SST32.SPSL_SST32

(Is your field name really SPSL_SST32?)

Ray at work

"Brian Piotrowski" <bp*********@NOSPAM.simcoeparts.com> wrote in message
news:ef*************@TK2MSFTNGP15.phx.gbl...
I saw that after I posted the message, and I changed it. It still didn't
seem to make a difference.

However, I removed "adOpenStatic, adLockReadOnly" from the statement, and now I get a new error:

IBMDA400 Command error '80004005'
SQL0204: SPSL_SST32 in SYSOPR type *FILE not found. Cause . . . . . :
SPSL_SST32 in SYSOPR type *FILE was not found. If this is an ALTER TABLE
statement and the type is *N, a constraint was not found. If this is not
an
ALTER TABLE statement and the type is *N, a function, procedure, or
trigger
was not found. Recovery . . . : Change the name and try the request again. If the object is a node group, ensure that the DB2 Multisystem product is installed on your system and create a nodegroup with the CRTNODGRP CL
command.

/ninja/showstatus.asp, line 15

It says that it can't find the file. If that is the case, then where
should
my file be located in order for this statement to find it? On our AS/400, the file is in SPSL/SST32.

Thanks,

Jul 21 '05 #5

"Brian Piotrowski" <bp*********@NOSPAM.simcoeparts.com> wrote in message
news:ef*************@TK2MSFTNGP15.phx.gbl...
I saw that after I posted the message, and I changed it. It still didn't
seem to make a difference.

However, I removed "adOpenStatic, adLockReadOnly" from the statement, and
now I get a new error:

IBMDA400 Command error '80004005'
SQL0204: SPSL_SST32 in SYSOPR type *FILE not found. Cause . . . . . :
SPSL_SST32 in SYSOPR type *FILE was not found. If this is an ALTER TABLE
statement and the type is *N, a constraint was not found. If this is not an ALTER TABLE statement and the type is *N, a function, procedure, or trigger was not found. Recovery . . . : Change the name and try the request again.
If the object is a node group, ensure that the DB2 Multisystem product is
installed on your system and create a nodegroup with the CRTNODGRP CL
command.

/ninja/showstatus.asp, line 15

It says that it can't find the file. If that is the case, then where should my file be located in order for this statement to find it? On our AS/400,
the file is in SPSL/SST32.

SQL_query = "SELECT * FROM SPSL_SST32 where otsddt = '20041012' and
otdrvr='sandy'"
In my bad old days coding against AS/400, we could never rely on the library
list of the authenticated person. So we would do

SQL_query = "SELECT * FROM libraryname.SPSL_SST32"....

We actually had some code in application_onstart to determine if it was a
test system or a prod system and dynamically determined the library name
based on that...

Hope that helps.
Thanks,

Brian.

"SyrOrange" <do************@netzero.net> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
I think you need to changes objConn to adoCon.

rsNINJA.open SQL_query, adoCon, adOpenStatic, adLockReadOnly
"Brian Piotrowski" <bp*********@NOSPAM.simcoeparts.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Hi All,

I almost have the connection working for my connection to the AS/400 from
an
ASP page. However, I have an error appearing, and I'm not sure how to

fix it. The code I have for connecting to the AS/400 is this:

<%
Set adoCon = Server.CreateObject("ADODB.Connection")
adoCon.Open "Provider=IBMDA400.DataSource.1;Persist Security
Info=False;User ID=XXXX;Password=XXXX;Data Source=192.168.0.20;Catalog
Library List=SPSL/SST32"
Set rsNINJA = Server.CreateObject("ADODB.Recordset")
SQL_query = "SELECT * FROM SPSL_SST32 where otsddt = '20041012' and
otdrvr='sandy'"
rsNINJA.open SQL_query, objConn, adOpenStatic, adLockReadOnly
intTotalColumns = RS.Fields.Count - 1
%>

However, when I execute the code, I get this:

ADODB.Recordset error '800a0bb9'
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.

/ninja/showstatus.asp, line 15

Line 15 in this case is the line that states "rsNINJA.open SQL_query,
objConn, adOpenStatic, adLockReadOnly".

If anyone could give me some ideas on what I need to fix here, I'd be
eternally grateful.

I know it is connecting, because if I change the password to a bad

password,
I'll get an error stating the password is incorrect.

Thank you!

Brian.



Jul 21 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Mike | last post by:
I'm trying to connect to a SQL 2000 db that is on another server then the web server. I setup and ID and PWD to access the SQL db via the code and it works locally and when I put the everything...
2
by: Rig76 | last post by:
I'm having a very strange issue with an application I'm building. The applicaiton has multiple users, each with their own connection to the database. However, when one of these connections closes...
2
by: JohnnyBoy | last post by:
I am learning to program C++ .net and am having difficulty with one of the exercises and wondered if someone could help? I am including the code for a console app I wrote according to the exercise...
1
by: OldButStillLearning | last post by:
OK, I am trying to connect to DB2 (z/OS). I have successfully made the connection to the database in the Server Explorer. I am also able to successfully log in to DB2 when I am testing the...
3
by: JD | last post by:
Hello, I am dealing with an issue, that although probably simple, is driving me crazy. I am trying to connect to a SQL 2005 Express database through a web service using the following code: ...
2
by: Luke | last post by:
I have recently set up a netgear wireless router into a modem and got the wireless working fine on one Xp laptop only. When I try connecting to the wireless from other laptops it doesn't work. I...
1
by: grnling | last post by:
OK...I work offshore and give support to many platforms, but lately have been having issue. Using a LYNKSYS wireless-G 2.4 on an XP Home network. I have severel users that lately having a 50/50...
2
by: Martin | last post by:
I have the following code being used in several of my PHP scripts (it's in an include file). It opens a socket connection to a process that's running on the same computer that IIS/PHP is running...
6
by: SRK | last post by:
Hi, I have installed free TDS ODBC driver on Linux and from there I am trying to connect to MS SQLSERVER installed on Windows machine. But it gives me following error - tsql -H ps6312 -p 1433...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.