gummylick
asked on
Calling a Program, Passing Parms from ASP to AS/400
I'm trying to call a program on our AS/400 and repeatedly get this error:
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[IBM][iSeries Access ODBC Driver][DB2 UDB]SQL0104 - Token / was not valid. Valid tokens: : <IDENTIFIER>.
On this line: cmd400.EXECUTE parms,adcmdtxt
Code:
Set cmd400 = Server.CreateObject("ADODB .Command")
Set cmd400.activeConnection = AS400
cmd400.CommandType = adCmdText
cmd400.CommandText = "{{CALL /QSYS.LIB/W2.LIB/W1LI.PGM( ?,?,?,?,?, ?,?)}}"
cmd400.Prepared = True
cmd400.Parameters.Append cmd400.CreateParameter("PS essid", adDecimal, adParamInput)
cmd400.Parameters(0).Preci sion = 10
cmd400.Parameters(0).Numer icScale = 0
cmd400.Parameters.Append cmd400.CreateParameter("PU ser", adChar, adParamInput,15)
cmd400.Parameters.Append cmd400.CreateParameter("PC usnr", adDecimal, adParamInput)
cmd400.Parameters(2).Preci sion = 6
cmd400.Parameters(2).Numer icScale = 0
cmd400.Parameters.Append cmd400.CreateParameter("PC pwd", adChar, adParamInput,25)
cmd400.Parameters.Append cmd400.CreateParameter("PI PAdd", adchar, adParamInput,15)
cmd400.Parameters.Append cmd400.CreateParameter("PI nout", adDecimal, adParamInput)
cmd400.Parameters(5).Preci sion = 1
cmd400.Parameters(5).Numer icScale = 0
cmd400.Parameters.Append cmd400.CreateParameter("PS uccess", adchar, adParamOutput,1)
psessid = session.sessionid
puser = uid
pcusnr = cnbr
pcpwd = pwd
pipadd = Request.ServerVariables("R emote_addr ")
pinout = 1
parms = array(psessid,puser,pcusnr ,pcpwd,pip add,pinout ,psuccess)
cmd400.EXECUTE parms,adcmdtxt
Thanks for your assistance.
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[IBM][iSeries Access ODBC Driver][DB2 UDB]SQL0104 - Token / was not valid. Valid tokens: : <IDENTIFIER>.
On this line: cmd400.EXECUTE parms,adcmdtxt
Code:
Set cmd400 = Server.CreateObject("ADODB
Set cmd400.activeConnection = AS400
cmd400.CommandType = adCmdText
cmd400.CommandText = "{{CALL /QSYS.LIB/W2.LIB/W1LI.PGM(
cmd400.Prepared = True
cmd400.Parameters.Append cmd400.CreateParameter("PS
cmd400.Parameters(0).Preci
cmd400.Parameters(0).Numer
cmd400.Parameters.Append cmd400.CreateParameter("PU
cmd400.Parameters.Append cmd400.CreateParameter("PC
cmd400.Parameters(2).Preci
cmd400.Parameters(2).Numer
cmd400.Parameters.Append cmd400.CreateParameter("PC
cmd400.Parameters.Append cmd400.CreateParameter("PI
cmd400.Parameters.Append cmd400.CreateParameter("PI
cmd400.Parameters(5).Preci
cmd400.Parameters(5).Numer
cmd400.Parameters.Append cmd400.CreateParameter("PS
psessid = session.sessionid
puser = uid
pcusnr = cnbr
pcpwd = pwd
pipadd = Request.ServerVariables("R
pinout = 1
parms = array(psessid,puser,pcusnr
cmd400.EXECUTE parms,adcmdtxt
Thanks for your assistance.
I do not think you need the first / as the defualt is the root directory
cmd400.CommandText = "{{CALL QSYS.LIB/W2.LIB/W1LI.PGM(? ,?,?,?,?,? ,?)}}"
cmd400.CommandText = "{{CALL QSYS.LIB/W2.LIB/W1LI.PGM(?
ASKER
Thanks for your suggestion, dave. I removed the "/" before "/QSYS.LIB" but continue to get the same error. Thanks for your help.
ASKER
When I remove "/QSYSLIB/" I get:
[IBM][iSeries Access ODBC Driver][DB2 UDB]SQL0104 - Token / was not valid. Valid tokens: <END-OF-STATEMENT>.
[IBM][iSeries Access ODBC Driver][DB2 UDB]SQL0104 - Token / was not valid. Valid tokens: <END-OF-STATEMENT>.
try either
cmd400.CommandText = "{{CALL W2/W1LI (?,?,?,?,?,?,?)}}"
or
cmd400.CommandText = "{{CALL W2.W1LI (?,?,?,?,?,?,?)}}"
ShalomC
cmd400.CommandText = "{{CALL W2/W1LI (?,?,?,?,?,?,?)}}"
or
cmd400.CommandText = "{{CALL W2.W1LI (?,?,?,?,?,?,?)}}"
ShalomC
Did you put the program on the AS400 as a stored procedure?
Program has to be registered as a stored procedure to handle the parameters.
ASKER
I ended up using a work around. :(.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
AS400Pgm.CommandText = "{{call DSLIB/PGM1(?)}}"
so you could try
cmd400.CommandText = "{{CALL W2.LIB/W1LI.PGM(?,?,?,?,?,
Dave