How do I UpdateBatch?

  • Thread starter Thread starter Jcasual
  • Start date Start date
J

Jcasual

I am using an access 97 db with vb front end.
I have opted to us disconnected recordsets. I need to know
how to update the database ONLY WHEN THE RECORD ON THE VB
FORM HAS BEEN UPDATED. I am not sure what event to use to
accomplish this. here the code I have to update the access
db:


cnn.Open cnStr

rstPlans.ActiveConnection = cnn
rstApps.ActiveConnection = cnn

rstPlans.UpdateBatch
rstApps.UpdateBatch

rstPlans.ActiveConnection = Nothing
rstApps.ActiveConnection = Nothing
cnn.Close
 
Hi,


You would have to use a VB-form event, or have to detect that the user
wish to move to another record with a specific key (such as PgUp/PgDn), or
when the user try to close the form... It is dependant of your form design.
You may even have a button click (I don't suggest it) that the user can use
to "tell" the computer to save the record! You probably have one to "abort"
(undo) the modifications, isn't it? Alternatively, if that kind of logic is
already implemented in the "recordset" navigation tool you have provided,
then you can try to get your hand on the ADO recordset events, such as
WillMove... if you declared your recordset WithEvents. Trapping those events
may also be part of some kind of defensive coding strategy, for complex
applications.


Hoping it may help,
Vanderghast, Access MVP
 
Back
Top