Solved

how can I solve this ERROR

Posted on 2002-05-21
10
692 Views
Last Modified: 2008-03-10
Hi,

if I run the following code i receive the error shown below :
Fmain.Adodc1.RecordSource = Levl
Fmain.Adodc1.Refresh
Fmain.Adodc2.RecordSource = Tr
Fmain.Adodc2.Refresh

Fmain.Adodc1.Recordset.Filter = ("ID = " & WDay)
Fmain.Adodc2.Recordset.Filter = ("ID = " & WDay)
     
If IsNull(Fmain.Adodc1.Recordset("Field" & PRD)) = True Then
     Fmain.Adodc1.Recordset("Field" & PRD) = SB
     Fmain.Adodc1.Recordset.Update
     Fmain.Adodc1.Recordset.Filter = ("ID > 0")
End If
     
 
Run Time Error  “2147217864 (80040e38)”

"The Specified Row Could Not Be Located For Updating ; Some Values May Have Been Changed Since It Was Last Read."

how can i solve this error? if i use 'on Error Resume next' i feel afraid it doesnt solve it but pass over it without updating the record.

Note: I use Access 97 table and ADO. wday & PRD are variables

Many Thanks
Toni2002
0
Comment
Question by:toni2002
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
10 Comments
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7025465
is your recordsource updatable?
Also, try not to use ado data control and manage db with active x data objects.
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7025466
You could trace with F8 to see where error has ocurred?
0
 

Author Comment

by:toni2002
ID: 7025490
Sir,
thanx for replying. my recordset is updated. i want to note that if i use F8 i don't receive this this error but in using F5 i receive it
the error occurs in this line :
Fmain.Adodc1.Recordset.Update

toni2002
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7025554
then, it appears like a timeout problem.
Try commenting the line that causes error since you are refreshing the filter, datacontrol should update the record for you and let me know.
It is not the best approach, just a try.
0
 
LVL 4

Expert Comment

by:trkcorp
ID: 7025592
Try this:

Between these 2 lines refresh the data control...

   Fmain.Adodc1.Recordset.Update

 <<Fmain.Adodc1.Refresh >>

   Fmain.Adodc1.Recordset.Filter = ("ID > 0")
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 7025632
WHat fields are in the recordsets?

What is the value of PRD?

mlmcc
0
 

Author Comment

by:toni2002
ID: 7026220
Hi,

PRD is integer . the field names which i want to be updated are Field1, Field2 , .....

thanks for help
0
 

Author Comment

by:toni2002
ID: 7026227
Hi experts,

now I am not in my office , then i'll try your suggestions may after 12 hours

Regards
thanks and i look forward your continuous help.

toni2002
0
 
LVL 2

Expert Comment

by:Ixeus
ID: 7026525
use

DoEvents

Between your updates and rs functions

-Ix
0
 
LVL 43

Accepted Solution

by:
TimCottee earned 50 total points
ID: 7026655
Do you have a primary key? If not then this is not surprising as in order to update only the specified row you need to have a unique key which identifies it. You may have more than one row with the same values and the implicit update statement may cause more than one row to be updated. Ensure that you have a primary key for the table and this problem will go away.
0

Featured Post

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question