Update method and Requery method

Update method and Requery method

Post by Tony Li » Tue, 09 Jan 2001 01:34:42



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

 
 
 

Update method and Requery method

Post by Edward Mille » Tue, 09 Jan 2001 13:50:51


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


 
 
 

Update method and Requery method

Post by Tony Li » Tue, 09 Jan 2001 14:05:22


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

 
 
 

Update method and Requery method

Post by Frank T » Wed, 10 Jan 2001 00:42:09


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

 
 
 

1. Using Requery method on Parameterized Queries

Hello,

I'm trying to use the DataEnvironment in VB6 to design a
parameterized query. I can call this query in code fine
using:

Call DataEnvironment.Command(parameters)

But when I try to requery the recordset using:

DataEnvironment.rsCommand.Requery

It fails stating that one or more variables have not been
provided. I've tried every way I can think of to get this
work, but I'm now at the end of my rope and need some
help. I'd like to get this recordset requeryed without
having to close it and re-open it.

Thanks,

Salaza

2. SQL Debugger error

3. Problem with Requery method and NT

4. Multiuser...Lock/Update/Unlock Records...does Delphi support this ???

5. Requery method don't eliminate deleted records

6. New Book

7. Requery Method help

8. How to get the current value of a sequence?

9. 'Requery' method does not block

10. Sort / Requery method

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

12. Requery method bug?

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