p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

proasp_codeclinic thread: Problem with UpdateBatch..Help!


Message #1 by =?iso-8859-1?q?Kiranmayi=20Deshpande?= <venkiran@y...> on Wed, 14 Feb 2001 10:21:38 -0800 (PST)
thanks  Subbu 
The code works..It works with adopendynamic too..
thanks a lot. :)

> Hey Kiran !!...
> 
> Some code changes that might help you out...
> 
> 1-Use the cursor lock type as adOpenKeySet instead of
> adOpenDynamic if u r using batch mode updates....
> 
> 2-Do a Batch Mode Update only after u update the
> entire recordset locally.....I mean, move
> objRS4.UpdateBatch after the for loop....
> 
> 3-And do a Resync AFTER u do an UpdateBatch and NOT
> BEFORE the UpdateBatch......
> 
> 4-Try Requery instead of a Resync....Since new records
> won't be available with Resync...
>  
> Hope this helps...
>    Cheers....
>       Subbu.....  
> 
> --- Kiranmayi Deshpande <venkiran@y...> wrote:
> > Hi
> > I am trying to update my database - table in mysql
> > through a ASP page.. But  the data does not get
> > updated. And i do not get any error either.
> > My code is-
> > objRS4.cursorlocation  = adUseClient
> > objRS4.open "cart", objConn, adopendynamic,
> > adlockBatchOptimistic, adcmdtable
> > objRS4.Movefirst
> > 'I do not want to update the first record..
> > objRs4.Movenext
> > while not objRS4.eof
> > For intcounter = 1 to objRS1.fields("count(*)")
> > If Request.Form("txta")(intcounter) = "" then
> > objRS4("Brb250mlcase") = 0
> > else
> > objRS4("Brb250mlcase") 
> > Request.Form("txta")(intcounter)
> > end if
> > If  Request.Form("txtb")(intcounter") = "" then
> > objRS4("Brb250mlcrate") = 0 else
> > objRS4("Brb250mlcrate") 
> > Request.Form("txtb")(intcounter)
> > end if
> > If Request.Form("txtc")(intcounter) = "" then
> > objRS4("Brc250mlcase") = 0 else
> > objRS4("Brc250mlcase") 
> > Request.Form("txtc")(intcounter)
> > end if
> > objRS4.Resync
> > objRS4.Update Batch
> > objRS4.movenext
> > Next
> > Wend
> > 
> > There is no problem with request.form..the values
> > are
> > carried over. I am doubtful about my syntax with
> > updatebatch and resync..
> > 
> > Please help!
> > Thanks
> > Kiran
> > 

  Return to Index