Solved

Please amend this code

Posted on 2002-07-27
7
216 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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 69

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

948 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

24 Experts available now in Live!

Get 1:1 Help Now