Link to home
Start Free TrialLog in
Avatar of globalterminal
globalterminal

asked on

stored procedure

i am having trouble gettting a stored procedure to work.  Using the following code i get this error:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E37)
[IBM][Client Access Express ODBC Driver (32-bit)][DB2/400 SQL]SQL7967 - PREPARE of statement QZ92D3E2CF9BFB1000 completed.

this is the code..its failing on the Execute statement.

Dim rsRETax,NewConnxRETax,NewCommandxRETax

set NewConnxRETax                         = server.CreateObject("ADODB.Connection")
NewConnxRETax.Open "test","gblodbc","odbcgbl"
      
set NewCommandxRETax                   = server.CreateObject ("ADODB.Command")
set NewCommandxRETax.ActiveConnection = NewConnxRETax

NewCommandxRETax.CommandText = "getOpenDvirByChassis"
NewCommandxRETax.CommandType = 4

NewCommandxRETax.Parameters.Append NewCommandxRETax.CreateParameter("term-code",200,1,30)
 NewCommandxRETax.Parameters.Append NewCommandxRETax.CreateParameter("chassis-number",200,1,30)

NewCommandxRETax("term-code") = "GBLDEV"
NewCommandxRETax("chassis-number") = "APLZ330211"

set rsRETax = NewCommandxRETax.Execute
set rsRETax = rsRETax.NextRecordset()

While not rsRETax.eof
     Response.Write "*" &  rsRETax(0) & "*"  & rsRETax(1) & "<br>"
     rsRETax.MoveNext
Wend
Avatar of Bob Butcher
Bob Butcher
Flag of United States of America image

For the heck of it - what would happen if you remove this statement -

NewCommandxRETax.CommandType = 4
You are connecting to an AS400?
Avatar of globalterminal
globalterminal

ASKER

yes as400
commenting out that line:

Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[IBM][Client Access Express ODBC Driver (32-bit)][DB2/400 SQL]SQL0104 - Token GETOPENDVIRBYCHASSIS was not valid. Valid tokens: ( END GET SET CALL DROP FREE HOLD LOCK OPEN.


SOLUTION
Avatar of Bob Butcher
Bob Butcher
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of Gary Patterson, CISSP
Gary Patterson, CISSP
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial