Updating one record at a time with ADO

R

rem120

I have a view on MSSQL which I load into a form in Access 2000 via ADO.

The view takes up to 5 seconds to generate depending on the number of
rows I ask for. On the same form are text boxes where the user can edit

various database values which are in turn used in the view's query.

My problem is that when the user edits these values, I need that to be
reflected in the controls that show the result of the view. The obvious

method is to refresh the form's query, but that can take a few seconds,

which is way too long when the user is only editing one record at a
time. Ultimately the user only needs to see the updated results of the
view for the record that the form is up to.

Is there a way to update a single record in an ADO recordset without
updating all of them? I have tried to use the Resync method, but it
seems to rely on the UniqueTable property, which I can not set,
presumably because the view joins many tables and contains many fields
that are not directly from the source tables (eg. there are some fields

in the view that are concatenations of source table fields). However,
the view does have a one-to-one relationship with the rows of one of
the source tables, and the primary key of that table is in the output
fields of the view.

Many thanks for anyone who can wrap their head around that and give me
a useful response :)
 
R

rem120

woohoo! i found the problem.

i couldnt set the UniqueTable property because i did an ORDER when i
was querying the view from the Access form. when i took that out the
UniqueTable could be set, and then the ResyncCommand property of the
form could be set, and then

Me.Recordset.Resync adAffectCurrent

updated the current row without requerying the whole view.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top