I only use this syntax to retrieve a record that I just created. I normally use forms in the EDIT mode only, hence, to add a new record, the system prompts the user for some information, adds some default values and executes an INSERT statement followed by the "...COUNT=INSERT" statement that retrieves the key to the record just added and opens the form with the added record in the EDIT mode. If I need to add records to more that one file, I would use the "...COUNT=INSERT" right after each insert. I have not had any problems with this approach in 15 years, even in environments where up to 10 users were adding records to the same table simultaneously... Javier,
Javier Valencia, PE President Valencia Technology Group, L.L.C. 14315 S. Twilight Ln, Suite #14 Olathe, Kansas 66062-4578 Office (913)829-0888 Fax (913)649-2904 Cell (913)915-3137 ================================================ Attention: The information contained in this message and or attachments is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from all system and destroy all copies. ====================================================== -----Original Message----- From: [email protected] [mailto:[EMAIL PROTECTED] Behalf Of Lawrence Lustig Sent: Monday, September 12, 2005 1:48 PM To: RBG7-L Mailing List Subject: [RBG7-L] - Re: COUNT = INSERT > I have never used this syntax, but I would also add the question " what > happens in a multi user environment"? If it always looks at just the last > row, then it would not always be the intended user's inserted row, but > perhaps another process's. > > I once heard that it was usually best to avoid using the record position/row > count in a table when possible if adhering to SQL structure. Buy hey, I > still use the COUNT = LAST in a few applications! COUNT = INSERT is different from COUNT = LAST and is intended to be multi-user safe. R:Base is maintaining a pointer to the last row entered by that session of R:Base -- it will work regardless of whether other people add subsequent rows (although I don't know what happens if another session deletes the most recent row you added). -- Larry
