Record will not delete

Michael Krugman admin at ktinet.net
Tue Nov 25 12:07:08 CST 2003


Hi Rusian:

I saw in the documentation to use k_ReadWrite to specify the 
permissions.  Is this done when the database is created?  The reason 
I'm asking is that the below code will not work:

>> curs = mDataBase.SQLSelect("SELECT * FROM Customers WHERE recID= 
>> 0+id, k_Read/Write")

My cursor is not nil and the record Id I'm getting is correct.

Mike
>>


On Nov 25, 2003, at 11:05 AM, Ruslan Zasukhin wrote:

> on 11/25/03 6:56 PM, Michael Krugman at admin at ktinet.net wrote:
>
> Hi Michael,
>
>> 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?
>
> It seems you have forget specify ReadWrite for cursor
>
>> 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
>
> -- 
> Best regards,
> Ruslan Zasukhin      [ I feel the need...the need for speed ]
> -------------------------------------------------------------
> e-mail: ruslan at paradigmasoft.com
> web: http://www.paradigmasoft.com
>
> To subscribe to the Valentina mail list go to:
> http://lists.macserve.net/mailman/listinfo/valentina
> -------------------------------------------------------------
>
> _______________________________________________
> Valentina mailing list
> Valentina at lists.macserve.net
> http://lists.macserve.net/mailman/listinfo/valentina
>



More information about the Valentina mailing list