>< I can't delet record! anybody hel

Results 1 to 2 of 2

Thread: >< I can't delet record! anybody hel

  1. #1
    Join Date
    Dec 1969

    Default >< I can't delet record! anybody hel

    Set connrecordset = Server.CreateObject("ADODB.Recordset")<BR> SQLLang = "SELECT * "<BR> SQLLang = SQLLang & "FROM lyrics "<BR> SQLLang = SQLLang & "WHERE TrackID = " & TN1 & " "<BR> SQLLang = SQLLang & "Order by TrackID "<BR>Connrecordset.Open SQLLang, conn, adOpenKeyset, adLockPessimistic, adCmdText<BR>X = 0<BR>%&#062;<BR> &#060;% &#039Loop through the recordset to make each entry in the list. %&#062;<BR>Third List:&#060;p&#062;<BR> &#060;% do while not Connrecordset.eof <BR> Connrecordset.Delete adaffectcurrent<BR> %&#062;<BR><BR>&#060;%=Connrecordset("TrackID")%&# 062;<BR> &#060;% Connrecordset.movenext <BR> loop<BR><BR>Connrecordset.close

  2. #2
    Join Date
    Dec 1969

    Default RE: >< I can't delet record! anybody

    First of all, your query makes no sense:<BR><BR>WHERE TrackID=nnn ORDER BY TrackId<BR><BR>Huh? There can *ONLY* be a SINGLE trackid, because<BR>of the TrackID=nnn restriction, so the ORDER BY is<BR>completely meaningless!<BR><BR>But anyway.....<BR><BR>You sure are doing it the hard way. Why not just:<BR><BR>&#060;%<BR>goodbye = "DELETE FROM lyrics WHERE TrackID = " & TN1 <BR>conn.Execute( goodbye )<BR>%&#062;<BR><BR>and be done with them all at once?<BR><BR>Hmmm...that won&#039t show you the things being deleted, of course. Do you care, a bunch? If I read the code right, you are only deleting one record, anyway, so what is the point of the loop?<BR><BR>But I am sure your code won&#039t work, where you delete the record and *then* try to extract info from it. Maybe get the info before deleting?<BR><BR><BR>

Posting Permissions

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