March 14, 2006 at 12:09 pm
Hi
I created a view because I want to retrieve all the records that have a Flag=1,the fields of the view are ArticleID,ArticleTitle,ArticleDate and Flag.
After executing a command on my VB form,I want to set the Flag to 3.
I used this Statement:
Rs2.Open"Select * from [V2] where Flag=1"
but after executing the command on my VB form,
This code Rs2!Flag=3 gave me an error ([V2] cannot be updated")
what's the reason and how can I deal with it?
Thanks a lot
March 14, 2006 at 12:48 pm
Ado opens a cursor to the view ( rs2.open)
with Rs2!Flag=3 you try to update it via the cursor.
What are you trying to do (only viewing or also updating)?
March 15, 2006 at 12:04 am
Well,as I said I have a view [V2].This view contains the following fields:ArticleID,ArticleTitle,ArticleDate and Flag.I have a VB form and I have 2 commands on it,with the first commandI want to retrieve all the articles that have a Flag=1I wrote the following statement:Rs2.Open"Select* [V2] where Flag=1 order by ArticleDate"Upon clicking on the other command,I want to set the flag of the current record from 1 to 3.I tried this code:Rs2!Flag=3 but it didn't work.A message:[V2] CANNOT BE UPDATED.What's wrong with it?Thanks
March 15, 2006 at 6:00 am
The recordset has more than one parameter for the open-command.
By default it requests the data in read-only mode.
See
http://www.w3schools.com/ado/met_rs_open.asp
for the available parameters.
Rs2.Open"Select * from [V2] where Flag=1",,adOpenKeyset
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply