Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts

    SQL DELET operation (Access2K, Win2KPro)

    This is actually something I want to do via ASP to an Access back-end, but you Access people might be best for the question.

    How can I page thru a recordset, mark records for deletion and then batch delete the marked records after the recordset has been paged thru?

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: SQL DELET operation (Access2K, Win2KPro)

    I'm confused by your subject. Do you want to use SQL to delete records or do you want to use a recordset? Is the user indicating the records to be deleted? Otherwise, I don't understand the need to use a recordset to do this.
    Charlotte

  3. #3
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: SQL DELET operation (Access2K, Win2KPro)

    <font color=448800> Oops! Forgot about SQL LIKE operator. Will try to use that instead. No need to respond. </font color=448800> <img src=/S/newbrain.gif border=0 alt=newbrain width=21 height=22>

    Apologies for being too terse. Here's the whole situation:

    I have a recordset (RS.1) that I need to compare to another recordset (RS.2). I am using INSTR to page thru RS.2 and find matches for each record in RS.1 like so:

    <font face="Georgia">if not myRS.EOF then

    do while not myRS.EOF
    if instr(myRS("FollowUpCaseNumber"), StaffingCaseNumber) > 0 then
    Response.Write myRS("FollowUpCaseNumber") & " <---> " & StaffingCaseNumber & "
    "
    i = i + 1
    end if

    myRS.MoveNext
    LOOP

    Response.Write "" & i & " Follow Ups for this staffing."

    Else

    Response.Write "No follow ups for this staffing.
    "

    end if</font face=georgia>

    This, obviously, generates a list of matches. The next step would be, if possible, to mark the records in the list so that, after running the loop, I can delete the records.

    in addition, I want to go thru each record in RS.1 to match with all records in RS.2 and delete all records in RS.1 that have no matches in RS.2. The loop above only displays matching records (which the user may want to delete); I need to find all records with no matches to maintain data consistency.

    If it is possible to user INSTR directly in a SQL Statement that would also work.

Posting Permissions

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