Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / Database Access / July 2005



Tip: Looking for answers? Try searching our database.

Update Problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Alan Hood - 26 Jul 2005 13:48 GMT
VB6 on XP SP2

The following code runs OK for most of the time but occasionally give a
'Cannot locate row for update' Error.

.movefirst
do while not .eof
 .fields("chq_amt") = 0
 .update
 .movenext
loop

Can anbody tell me where the problem is ?

Alan Hood
Jan Hyde - 26 Jul 2005 14:08 GMT
"Alan Hood" <hood@dial.pipex.com>'s wild thoughts were
released on Tue, 26 Jul 2005 13:48:52 +0100 bearing the
following fruit:

>VB6 on XP SP2
>
[quoted text clipped - 11 lines]
>
>Alan Hood

Have you checked to see if the record does in fact still
exist when you attempt the update?

Jan Hyde (VB MVP)

Signature

Feel good?  Don't worry; you'll get over it!

[Abolish the TV Licence - http://www.tvlicensing.biz/]

Alan Hood - 26 Jul 2005 14:49 GMT
> Have you checked to see if the record does in fact still
> exist when you attempt the update?

Many thanks for the response. However I'm not sure what you mean. Surely if
I am not at the end of file the record exists (It is a client side cursor).
Could you explain further.

Many thanks

Alan Hood
Jan Hyde - 26 Jul 2005 17:01 GMT
"Alan Hood" <hood@dial.pipex.com>'s wild thoughts were
released on Tue, 26 Jul 2005 14:49:21 +0100 bearing the
following fruit:

>> Have you checked to see if the record does in fact still
>> exist when you attempt the update?
>
>Many thanks for the response. However I'm not sure what you mean. Surely if
>I am not at the end of file the record exists (It is a client side cursor).
>Could you explain further.

Just because the data exists in your recordset does not
prevent data from changing or being deleted on the server.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/mdco
ncursorlocationsignificance.asp


Jan Hyde (VB MVP)

Signature

Two Aerials met on a roof, fell in love & got married. The ceremony
was rubbish but the reception was brilliant.

[Abolish the TV Licence - http://www.tvlicensing.biz/]

Alan Hood - 27 Jul 2005 10:14 GMT
I can see what you are saying. I assume that the best way to handle this is
with an error trap.

Many Thanks

Alan Hood
> "Alan Hood" <hood@dial.pipex.com>'s wild thoughts were
> released on Tue, 26 Jul 2005 14:49:21 +0100 bearing the
[quoted text clipped - 9 lines]
> Just because the data exists in your recordset does not
> prevent data from changing or being deleted on the server.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/mdco
ncursorlocationsignificance.asp


> Jan Hyde (VB MVP)
Jan Hyde - 27 Jul 2005 14:42 GMT
"Alan Hood" <hood@dial.pipex.com>'s wild thoughts were
released on Wed, 27 Jul 2005 10:14:16 +0100 bearing the
following fruit:

>I can see what you are saying. I assume that the best way to handle this is
>with an error trap.

And then what? You see, it's possible the record DOES exist
but is locked by someone else.

J

>Many Thanks
>
[quoted text clipped - 18 lines]
>>
>> Jan Hyde (VB MVP)

Jan Hyde (VB MVP)

Signature

When he saw his wanted poster, he said, "I've been framed." (Jumble)

[Abolish the TV Licence - http://www.tvlicensing.biz/]

boaz - 26 Jul 2005 21:42 GMT
Will adding BOF make any difference?

If Not .BOF Then
   .MoveFirst
   Do While Not .EOF
       .Fields("chq_amt") = 0
       .Update
       .MoveNext
   Loop
End If

> VB6 on XP SP2
>
[quoted text clipped - 11 lines]
>
> Alan Hood
Alan Hood - 27 Jul 2005 14:49 GMT
I have found where the problem is with this.  It seems to be dependent on
the size of the recordset. If the recordset has more that about 35 records
in it it seems to get lost.

Alan Hood

> VB6 on XP SP2
>
[quoted text clipped - 11 lines]
>
> Alan Hood
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.