Please amend this code

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

ray14Asked:
Who is Participating?
 
Éric MoreauConnect With a Mentor Senior .Net ConsultantCommented:
fredthered, Edit does not exist in ADO.

ray14 , your command is surely read-only. Change it to anything else.
0
 
Arthur_WoodCommented:
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
 
ray14Author Commented:
Hi Arthur Wood ,

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

Thanx

0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
ray14Author Commented:
Hi Arthur Wood ,

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

Thanx

0
 
Arthur_WoodCommented:
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
 
John Mc HaleForensic Computer Examiner, Analyst/Programmer & Database ArchitectCommented:
Ray14

Does DataEnvironment support

DataEnvironment.rsCom1.MoveFirst

DataEnvironment.rsCom1.Edit

DataEnvironment.rsCom1![F1] = i

DataEnvironment.rsCom1.Update

0
 
ray14Author Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.