#1
  1. Contributing User

    Join Date
    Apr 2010
    Location
    Tezpur
    Posts
    223
    Rep Power
    8

    Function Not Work Properly


    Code:
    <%
    Public Sub GET_HASAN(RAZA)
    Set rs=TheDB.Execute("SELECT mid FROM member where placeunder='"&RAZA&"'")
    If Not rs.EOF = True Then
    l = rs("mid")
    Call GET_IDEA1((l))	
    End If
    rs.Close
    Set rs = Nothing
    End Sub
    
    Public Sub GET_IDEA1(RAZA)
    call SET_L((RAZA))
    Set rs=TheDB.Execute("SELECT mid FROM member where placeunder='"&RAZA&"'")
    If Not rs.EOF = True Then
    l = rs("mid")
    Call GET_IDEA1((l))
    End If     
    End Sub
    
    Public Sub SET_L(RAZA)
    Set rs=TheDB.Execute("SELECT * FROM member where mid='"&RAZA&"' and unit=1")
    If Not rs.EOF = True Then
    Set oRsMW=TheDB.Execute("SELECT * FROM productdtl where purcsmid='"&RAZA&"'")
    If Not oRsMW.EOF = True Then
    minc=minc+oRsMW("proctinr")
    end if
    LSD=LSD+rs("unit") 
    end if
    End Sub
    %>
    this code looks ok but not calculating all records...
    if you found this post is useful click (right side on this reply ) and agree
  2. #2
  3. Contributing User

    Join Date
    Apr 2010
    Location
    Tezpur
    Posts
    223
    Rep Power
    8
    Working code
    Code:
    <%
    Public Sub GET_HASAN(RAZA)
    Set rs=TheDB.Execute("SELECT mid FROM member where placeunder='"&RAZA&"'")
    do while not rs.eof=true
    l = rs("mid")
    Call GET_IDEA1((l))	
    rs.moveNext
    loop
    rs.Close
    Set rs = Nothing
    End Sub
    Public Sub GET_IDEA1(RAZA)
    call SET_L((RAZA))
    Set rs=TheDB.Execute("SELECT mid FROM member where placeunder='"&RAZA&"'")
    do while not rs.eof=true
    l = rs("mid")
    Call GET_IDEA1((l))
    rs.moveNext
    loop    
    End Sub
    Public Sub SET_L(RAZA)
    Set rs=TheDB.Execute("SELECT * FROM member where mid='"&RAZA&"' and unit=1")
    do while not rs.eof=true
    Set oRsMW=TheDB.Execute("SELECT * FROM productdtl where purcsmid='"&RAZA&"'")
    do while not oRsMW.eof=true
    minc=minc+oRsMW("proctinr")
    oRsMW.moveNext
    loop
    LSD=LSD+rs("unit") 
    rs.moveNext
    loop
    End Sub
    %>

Similar Threads

  1. Warning set to false loop does not function properly.
    By Jiefu in forum Visual Basic Programming
    Replies: 0
    Last Post: July 27th, 2010, 02:56 PM
  2. E.row.attribute ondblclick does not function properly
    By kardson in forum .NET Development
    Replies: 3
    Last Post: May 19th, 2009, 04:07 PM
  3. Form does not work properly
    By seoguru in forum ASP Development
    Replies: 1
    Last Post: August 12th, 2008, 03:47 AM
  4. I can't get this SQL to work properly...
    By bego in forum ASP Development
    Replies: 10
    Last Post: October 8th, 2005, 06:15 PM
  5. CreateObject does not work properly
    By Ultraman in forum ASP Development
    Replies: 3
    Last Post: February 21st, 2005, 05:00 PM

IMN logo majestic logo threadwatch logo seochat tools logo