ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

VBScript II using variable from SQL within ASP

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

  • VBScript II using variable from SQL within ASP

    To declare a variable in VBSCRIPT use
    Dim

    example:

    Dim SQLWeight

    a group define:
    Dim sDB2String,UID, SQLStmt, Connection


    as always the connection string
    Code:
    Set Connection = Server.CreateObject("ADODB.Connection")
    Connection.Open "Provider=IBMDA400;User ID=NAME;Password=PASSWORD;Data Source=10.10.10.10;"
    Then you can use this variable to retrieve Iseries data
    into this variable.


    Code:
    Dim SQLweight
    
    
    <%
      sqlstmt = "SELECT sum(WADLWT)as TotalShippedLBI  FROM lbifil.wkartno WHERE WADAT = "  & currentdate 
      set SQLweight = connection.Execute(sqlstmt)
    %>
    <% Response.Write " <B>Routed Today (LBI):</b>  " & SQLweight("totalshippedLBI")%>
    <BR>
    <%
      sqlstmt = "SELECT sum(WADLWT)as TotalShippedLSN  FROM lsnfil.wkartno WHERE WADAT = "  & currentdate 
      set SQLweight = connection.Execute(sqlstmt)
    %>
    <% Response.Write " <B>Routed Today (LSN):</b>  " & SQLweight("totalshippedLSN")%>
    <BR>
    <%
      sqlstmt = "SELECT sum(WADLWT)as TotalShippedPDM  FROM pdmfil.wkartno WHERE WADAT = "  & currentdate 
      set SQLweight = connection.Execute(sqlstmt)
    %>
    <% Response.Write " <B>Routed Today (PDM):</b>  " & SQLweight("totalshippedPDM")%>
    <BR>
    Attached Files
    Last edited by jamief; December 8, 2006, 03:51 PM. Reason: formatting
    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

  • #2
    Re: VBScript II using variable from SQL within ASP

    Nice stuff Jamie !!!
    Thanks,
    Giri

    Comment

    Working...
    X