× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Thank you ever so much for all the help Dave/Vern I will get Arthur to look at 
these on Monday and let you know how it pans out.

Steve

-----Oorspronkelijk bericht-----
Van: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx]Namens Dave Odom
Verzonden: vrijdag 1 december 2006 0:54
Aan: midrange-l@xxxxxxxxxxxx
Onderwerp: Dave Odom was RE: Mark Allen, were you the one that's trying


Steve,
 
Sorry I didn't respond quickly; had to go do some other work at another
location.   On to sending numerics to DB2/400 via .ASP...
 
If I understand what you're doing, here are two small examples of what
I have done to pass numerics both to validate a numeric and INSERT a
numeric.  In both cases, I'm using SQL.  The first example passing
dynamic SQL, the second example using a stored procedure to do the
INSERT but passing the numeric to it, which, to me, is what you were
talking about:
 
***********************  Inquiry passing a Numeric
***********************
 
<%
  '*******************************
  ' create session level variables
  '*******************************
  Session("Account") = trim(request.form("Account"))
  ' Session("Cycle") = trim(request.form("Cycle"))
  Session("Zip") = trim(request.form("Zipcode"))
  Session("Email") = trim(request.form("email"))
  Session("VEmail") = trim(request.form("verifyemail"))
 
  Dim intPosition
  intPosition = Instr(Session("Account"), "-")
  Session("CID") = CLng(Left(Session("Account"),intPosition-1))
  Session("LID") =
CLng(Right(Session("Account"),Len(Session("Account"))-intPosition))
 
 
  '***************************************
  ' set initial number of enrollment tries
  '***************************************
  If Session("ErrorCnt")="" then
    Session("ErrorCnt") = 0
  End If
 

  '*************************************************************
  ' look for inactive account request
  ' redirect to enroll page with inactive notice if account 
  ' number inactivated in access database
  '*************************************************************
  Dim objRS
  Dim objCmd
  Dim strSQL
 
  Set objRS = Server.CreateObject("ADODB.Recordset")
  strSQL = "SELECT * FROM DODOM1.C2GENROL0 WHERE ACCT_NUM =
'"&Session("Account")&"' AND Inactive = -1"
  objRS.Open strSQL, objConn
 
  if not objRS.EOF then
    objRS.Close
    Set objRS = Nothing
    objConn.Close
    Set objConn=Nothing
    Response.Redirect "Enroll.asp?Inactive=True"
 
  end if
 
********************  INSERT of numeric and non-numeric via Stored
Procedure  *****
 
 

'Call add Stored Procedures
Set AS400Command = Server.CreateObject("ADODB.Command")
AS400Command.ActiveConnection = objConn
 
AS400Command.CommandText = "DODOM1.SETPIN"
AS400Command.CommandType = adCmdStoredProc
 
Set parm1 = AS400Command.CreateParameter("FRMACCOUNT") 
parm1.Type = adVarChar
parm1.Direction = adParamInput
parm1.size = 55
parm1.Value = Session("Account")
AS400Command.Parameters.Append parm1
 
Set parm2 = AS400Command.CreateParameter("FRMCID")
parm2.Type = adVarChar
parm2.Direction = adParamInput
parm2.size = 20
parm2.Value = Left(Session("Account"),intPosition-1)
AS400Command.Parameters.Append parm2
 
Set parm3 = AS400Command.CreateParameter("FRMLID")
parm3.Type = adVarChar
parm3.Direction = adParamInput
parm3.size = 20
parm3.Value =
Right(Session("Account"),Len(Session("Account"))-intPosition) 
AS400Command.Parameters.Append parm3
 
Set parm4 = AS400Command.CreateParameter("FRMPIN")
parm4.Type = adVarChar
parm4.Direction = adParamInput
parm4.size = 10
parm4.Value = AS400File_rs("PIN")
AS400Command.Parameters.Append parm4
 
Set parm5 = AS400Command.CreateParameter("FRMZIP")
parm5.Type = adVarChar
parm5.Direction = adParamInput
parm5.Value = Session("Zip")
parm5.size = 20
AS400Command.Parameters.Append parm5
 
Set parm6 = AS400Command.CreateParameter("FRMEMAIL")
parm6.Type = adVarChar
parm6.Direction = adParamInput
parm6.size = 55
parm6.Value = Session("Email")
AS400Command.Parameters.Append parm6
 
Set parm7 = AS400Command.CreateParameter("FRMINACTIVE")
parm7.Type = adVarChar
parm7.Direction = adParamInput
parm7.Value = "0"
parm7.size = 1
AS400Command.Parameters.Append parm7
 
Set parm8 = AS400Command.CreateParameter("FRMENROL_DTE")
parm8.Type = adVarChar
parm8.Direction = adParamInput
parm8.Value = Timestamp
parm8.size = 55
AS400Command.Parameters.Append parm8
 
 'Execute the command on the AS/400 
   AS400Command.Execute
 
 
HTH,
 
Dave
 
 
 

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.