Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: Vaildating

  1. #1
    Regular Coder
    Join Date
    Jul 2002
    Location
    UK
    Posts
    302
    Thanks
    16
    Thanked 0 Times in 0 Posts

    Vaildating

    I'm not to sure where I should have posted this question, if it needs to be moved then so be it!

    I have created a hta application and I need a little bit of help validating the my del function. I need it to say " Are you sure you want to remove this record"

    Here is the string.

    [QUOTE]
    strHTML = strHTML & "<tr><td onclick='deleteUser("& rsData("ID") &")' language='vbscript' style='cursor:hand; color:red'>del</td><td>" & rsData("Title") & "</td> <td>" & rsData("Cat") & " </td> <td>" & rsData("Notes") & " </td><td onclick='editUser("& rsData("ID") &")' language='vbscript' style='cursor:hand; color:red'>Edit</td></tr>"
    [QUOTE]


    and this is the sub that removes it from my database.

    [QUOTE]
    sub deleteUser(id)
    SQL_query = "DELETE * FROM xbox WHERE ID = " & id <>
    conn.Execute(SQL_query)
    getdata

    end sub
    [QUOTE]
    Kind regards,
    Mike Hughes

  • #2
    Regular Coder
    Join Date
    May 2002
    Location
    Virginia, USA
    Posts
    620
    Thanks
    0
    Thanked 6 Times in 6 Posts
    Code:
    Sub deleteUser(id)
    
    If MsgBox("Are you sure you want to remove this record?", vbYesNo) = vbYes  Then
         MsgBox("Deleting User")
         SQL_query = "DELETE * FROM xbox WHERE ID = " & id <>
         conn.Execute(SQL_query)
         getdata
    Else
         MsgBox("Aborting.")
    End If
    
    End Sub
    hth,
    -Celt


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •