Solved

Please amend this code

Posted on 2002-07-27
7
218 Views
Last Modified: 2010-05-02
Hi,

In my project I use Access 2000 and Dataenvironment. in  the following code I want to change the value of the field “F1” to be = the variable "i" , but it gives me error.

the code:
DataEnvironment1.rsCom1.MoveFirst
DataEnvironment1. rsCom1!F1 = i

Here it gives me this error message:
“The operation requested by the application is not supported by the provider “

Note:
I use these sentences instead , but no way
DataEnvironment1. rsCom1(F1) = i
Or
DataEnvironment1. rsCom1.Fields(F1).Value = i

Please I need your help to amend the code

Thanx

0
Comment
Question by:ray14
7 Comments
 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 7182681
change to either:

DataEnvironment1. rsCom1("F1") = i
Or
DataEnvironment1. rsCom1.Fields("F1").Value = i

since F1 is the NAME of the field, it must be passed as a string value.

Arthur Wood
0
 

Author Comment

by:ray14
ID: 7182693
Hi Arthur Wood ,

still the same error!!! Please help again...

Thanx

0
 

Author Comment

by:ray14
ID: 7182698
Hi Arthur Wood ,

still the same error!!! Please help again...

Thanx

0
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 7182699
gueuss you Can't change the value in the recordset associated with a Datraenvironment.  I do not use DEs, so I can't help beyond that.  Sorry.  My guess would be that the Associated recordset set is a Static Type, hence cannot be updated.

Arthur Wood
0
 
LVL 13

Expert Comment

by:John Mc Hale
ID: 7182849
Ray14

Does DataEnvironment support

DataEnvironment.rsCom1.MoveFirst

DataEnvironment.rsCom1.Edit

DataEnvironment.rsCom1![F1] = i

DataEnvironment.rsCom1.Update

0
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 50 total points
ID: 7183010
fredthered, Edit does not exist in ADO.

ray14 , your command is surely read-only. Change it to anything else.
0
 

Author Comment

by:ray14
ID: 7183273
hi emoreau,

Sorry for being late.
You are right. The command was Read only ...I changed it into "Optimistic" then it runs well !!!

Many Many Thanks!!!
Ray14
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

813 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now