Update method and Requery method 
Author Message
 Update method and Requery method

I have a recordset opened with adOpenDynamic and adLockOptimistic setting.

I have a form scope recordset variable that will be used throughtout the
entire form, then I tried to do the following:

1.) Create a new record with the recordset with default value, for example,
I assign the value "John" in the name field, then call the Update method
2.) Update the record with a new value
3.) Show the updated record somewhere

Here come's the problem, if I just follow the above steps, I can't even
update the record, I mean, the update method didn't return any errors , but
it just didn't update the record with the new value, and of course, it won't
show the new value at step 3 as well

However, if I call the Requery method right after the Update method in step
1, problems gone.  I am just wondering why would this happen, or did I done
something wrong.

Any idea?

Thans

Tony



Fri, 27 Jun 2003 00:34:42 GMT  
 Update method and Requery method
You probably don't really have a dynamic cursor.  If you have a client side
cursor, then no matter what you requested, you get a Static cursor.  With a
static client side cursor, you must call requery to update your client side
recordset with the changes you made to the underlying data.  Looks like you
just go a little experience.

--
regards,
ed

Experience is what you get when you
don't get what you wanted.


Quote:
> I have a recordset opened with adOpenDynamic and adLockOptimistic setting.

> I have a form scope recordset variable that will be used throughtout the
> entire form, then I tried to do the following:

> 1.) Create a new record with the recordset with default value, for
example,
> I assign the value "John" in the name field, then call the Update method
> 2.) Update the record with a new value
> 3.) Show the updated record somewhere

> Here come's the problem, if I just follow the above steps, I can't even
> update the record, I mean, the update method didn't return any errors ,
but
> it just didn't update the record with the new value, and of course, it
won't
> show the new value at step 3 as well

> However, if I call the Requery method right after the Update method in
step
> 1, problems gone.  I am just wondering why would this happen, or did I
done
> something wrong.

> Any idea?

> Thans

> Tony



Fri, 27 Jun 2003 12:50:51 GMT  
 Update method and Requery method
Thanks for reply, but how do I know if I really have a "true" dynamic cursor
or not?

I don't know why would this happen because I am using Access 2000 and open
the recordset with adOpenDynamic and adLockOptimistic setting, but I didn't
change the CursorLocation property.

What did I missed?  Isn't setting the  CursorType  to adOpenDynamic suppose
to get a dynamic cursor?

Thanks

Tony



Fri, 27 Jun 2003 13:05:22 GMT  
 Update method and Requery method
Run your application and use the immediate windows to catch the value of the
cursor side/cursor type.

If you have a "true" dynamic cursor, the line
"Print YourRecordset.CursorType" should return 2.

however, I think the default Cursor Location is AdUseClient, which is
incompatible with dynamic cursor type (but in this case ADO will not return
any errors.  He simply replace the cursor location at Client Side)


Quote:
> Thanks for reply, but how do I know if I really have a "true" dynamic
cursor
> or not?

> I don't know why would this happen because I am using Access 2000 and open
> the recordset with adOpenDynamic and adLockOptimistic setting, but I
didn't
> change the CursorLocation property.

> What did I missed?  Isn't setting the  CursorType  to adOpenDynamic
suppose
> to get a dynamic cursor?

> Thanks

> Tony



Fri, 27 Jun 2003 23:42:09 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Requery Method

2. Is the requery method asynchronous?

3. Requery Method help

4. Requery method not working

5. Requery method for VB3.0 Dynasets ???

6. Problem with Requery method and NT

7. Requery Method

8. Using Requery method on Parameterized Queries

9. AddNew/REquery method of ADO Recordset not Working?

10. ?What are the options for the ReQuery method?

11. Requery Method

12. Updating Links in Word 2002, Edit, Links, Select Update Method

 

 
Powered by phpBB® Forum Software