ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

latest ASP experiment

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • latest ASP experiment

    updating iseries table from ASp in windows2003 server using vb and java script

    ASP - i know the formatting is hacked but thats a battle
    for another day

    Code:
    <%@ LANGUAGE="VBScript" %>
    <% 
    	Option Explicit
    	Dim sDB2String,UID, sqlstmt, Connection 
    	Dim RS
            Dim Formfname
            Dim Formlname
            Dim Formfull
            Dim Formdept
            Dim Formext
            Dim Formphone
    	  Dim Formbirthday
    
    
    	Set Connection = Server.CreateObject("ADODB.Connection")
    	Connection.Open "Provider=IBMDA400;User ID=xxxxx;Password=xxxxxx;Data Source=10.10.10.10;"
    %>
    <form action="form.asp" method="post" name="myform">
      
      <html>
      <head>
      <title>Text Document</title>
      <script language="JavaScript" src="calendar1.js"></script>
      <script language="JavaScript" src="calendar2.js"></script>
      </head>
      <body bgcolor='#D2D2D2'>
      <table  bgcolor='#000000' cellspacing='1px' cellpadding='5px' width='60%'>
      <tr><td bgcolor='#FFFFFF' >
    
           
    First name &nbsp;&nbsp;: <input type="text" name="fname" size="30" />
    <br>
    last name  &nbsp;&nbsp;&nbsp; : <input type="text" name="lname" size="40" />
    <br>
    Department : <input type="text" name="dept" size="25" />
    <br>
    Extension &nbsp;&nbsp; : <input type="text" name="ext" size="4" />
    <br>
    Phone      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: <input type="text" name="phone" size="12" />
    <br>
    Select Date :
    <input type="Text" name="bday" value="" size="10" >
    <a href="javascript:cal1.popup();">
    <img src="images/cal.gif" width="16" height="16" border="0" alt="Click Here to Pick up the date">
    </a>
    
    <br><br>
    <input type="submit" value="Submit" />
    </form>
    
    <script language="JavaScript">
    var cal1 = new calendar2(document.forms['myform'].elements['bday']);
    				cal1.year_scroll = true;
    				cal1.time_comp = false;
    //-->
    </script>
    
    
    
     
      </td></tr>
      </table>
      </body>
      </html>
    
    
    <%
    dim fname
    fname=Request.Form("fname")
    
    
    If fname<>"" Then
    Formfname = Request.Form("fname")
    Formlname = Request.Form("lname")
    
    ' show  *CAT just use the "+" sign all text uses double quotes 
    Formfull  = Request.Form("fname") + " " + Request.Form("lname")
    
    'birthdate selection
    FormBirthday = Request.Form("bday")
    
    
    Formdept  = Request.Form("dept")
    Formext   = Request.Form("ext")
    Formphone = Request.Form("phone")
    
    
    sqlstmt = "insert into JAMIELIB.PHONEP (FIRSTNAME, LASTNAME , FULLNAME , DEPARTMENT, EXTENSION, PHONE, DATE ) values('" & formfname & "' ,'" & formlname & "','" & formfull & "','" & formdept & "','" & formext & "','" & formphone & "','" & formbirthday & "')" 
    set RS = Connection.Execute(sqlstmt)
    ' set fname = *blanks so that the if statement above fails and duplicate record posting is stoped.
    fname =  " " 
    End If
    
    %>
    DDS on iseries
    PHP Code:
        A          R PHONER                   
        A            FIRSTNAME     30A        
        A            LASTNAME      40A        
        A            FULLNAME      75A        
        A            DEPARTMENT    25A        
        A            EXTENSION      4         
        A            PHONE         12         
        A            DATE          10         
                                              
        A          K LASTNAME 
    see attached image for view
    Attached Files
    All my answers were extracted from the "Big Dummy's Guide to the As400"
    and I take no responsibility for any of them.

    www.code400.com
Working...
X