Record will not delete

Michael Krugman admin at ktinet.net
Tue Nov 25 10:56:06 CST 2003


Hi Rusian and List:

I am trying just to delete a single record from my database.  I'm using 
10.3.1, with RB 5.22.  Below is the code I am using.  Can someone 
please look at it and tell me what I am missing?  I am getting no 
errors. and I'm using a msgbox that tells me I have the right record in 
the cursor....it just will not delete no matter what I do.  I added 
comments next to the code to help make sense out if to you.  Any help 
is appreciated!  Thank you.

Mike

   id = Main.Customers.cell(Main.Customers.Listindex, 0)                
//  I am using a RB listbox to view records.  This line gets the value 
of the first field in the listbox, which is the same as the record id.

    //Warn user...Are you sure you want to delete this customer?
   patdelwarn.ShowModal
   if patdelwarn.PressedOK then              //User clicked YES

  // Get the record with the matching ID into the cursor
     curs = mDataBase.SQLSelect("SELECT * FROM Customers WHERE recID=" + 
id)  // I place a msgbox right after this line to tell me which record 
is in the cursor.  This matches with the one I selected in the listbox.
     if curs <> nil then
       res = curs.Delete
       'res = mDataBase.mPatient.DeleteRecord            //This is 
commented out.  I tried using this too, with no result
     end if



More information about the Valentina mailing list