How to loop through DB and prompt whether to execute sql

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Court K

    #1

    How to loop through DB and prompt whether to execute sql

    I want to loop through a database using a sql statement that looks for empty fields and then prompts the user on whether to run an UPDATE sql per record found. Something like below which may need to resend back to the server each time, I guess.

    Code:
    function PromptUser(ID)
    prompt user to enter stop time or not
    if user presses yes execute UPDATE sql and enter stop time
    else
    next prompt
    }
    
    sql = "SELECT TblTimeSheet.TimeSheetID TblTimeSheet.Employee, TblTimeSheet.Stop FROM TblTimeSheet WHERE Employee = 'Jack' AND IsNull(Stop)"
    Do Until objRS.EOF
    If objRS.EOF AND objRS.BOF Then
    'do nothing
    Else
    Response.Write("<SCRIPT>function PromptUser(" & TimeSheetID & ("}</SCRIPT>")
    objRS.MoveNext
    Loop
    End If
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    Court K, what technology are you using to implement your application?

    -Frinny

    Comment

    Working...