Armando wrote:Servicomver:
Ya entrados en gastos, te recomiendo que no uses la función oRs:AddNew() + oRs:Update(), mas adelante
te puedes encontrar con pequeños problemas, en su lugar utiliza los comandos INSERT INTO y UPDATE.
Saludos
I have been using ADO from the time it was released by Microsoft. Used with Oracle, MsSql, MySql, Access, Dbf, Foxpro, etc.
I never faced any issues with AddNew().
I can say that Update() and AddNew() methods are as robust as UPDATE and INSERT commands.
In addition, it is advisable to use Update() and AddNew() but not direct UPDATE / INSERT commands to avoid the need to Requery() everytime. Note: Requery() puts lot of strain on server and network traffic. Good programming practice is to avoid requery() unless essential.
One commonly used method is:
- Code: Select all Expand view RUN
oRs:AddNew()
// assign field values
oRs:Update()
Better method is:
- Code: Select all Expand view RUN
oRs:AddNew( ArrayOfFieldNamesOrNumbers, ArrayOfValues )
In this case we can use normal Harbour values.
Note: Always use these methods within TRY/CATCH.