Infralution Support Forum Index Infralution Support
Support groups for Infralution products
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Updating doesn't work

 
Post new topic   Reply to topic    Infralution Support Forum Index -> Virtual Data Objects Support
View previous topic :: View next topic  
Author Message
mos



Joined: 19 Nov 2006
Posts: 4

PostPosted: Mon Feb 19, 2007 6:41 am    Post subject: Updating doesn't work Reply with quote

Hi,

i try to update according to the code out of your help file:

[code]
VirtualConnection vc = new VirtualConnection("dsn=lds-db2","drbe","1606",-1,2, CursorLocationEnum.adUseClient,CursorTypeEnum.adOpenKeyset,LockTypeEnum.adLockOptimistic);
VirtualRecordset vrs = new VirtualRecordset(vc, "clients", "id", "SELECT * FROM clients");
vrs.SortField = "id";
VirtualRecord vr = vrs[2];
vr.Edit();
vr["name1"] = "Blender";
if (vr.IsEditing) vr.CancelUpdate();
[/code]

if i debug the code i can see that the CancelUpdate function is called, but afterwards the name1 is replaced by the given name. I can't find an error. Do you have an idea where the problem is located?

Greetings,
Marc
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 4972

PostPosted: Mon Feb 19, 2007 9:39 pm    Post subject: Reply with quote

If you don't use the explicit Edit then Virtual Data Objects will call Update automatically (which would mean you could not cancel). However you are calling Edit and I can't see anything else wrong with your code.

I've just verified that this code behaves as expected when used with a client side cursor with both Access and SQL-Server providers. This leads me to believe it may be a problem with the provider. You can check this fairly easily by executing the same code with raw ADODB.

Is the data actually committed to the database following the code - or are you just checking the in memory value of vr after the CancelUpdate?
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Infralution Support Forum Index -> Virtual Data Objects Support All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group