how do i edit a recoed in ado 
Author Message
 how do i edit a recoed in ado
There is no edit operation but only an editmode constant that only gives the
status of the edit.
So how do i edit a record?


Sun, 18 Apr 2004 13:16:18 GMT
 how do i edit a recoed in ado

Just change the value and update

rs.Fields("myfield").value = newvalue
rs.Update

--
Saludos, Jorge Jimenez, SICAD S.A., Costa Rica
(remove the obvious to send e-mail)


Quote:
> There is no edit operation but only an editmode constant that only gives
the
> status of the edit.
> So how do i edit a record?



Mon, 19 Apr 2004 01:16:47 GMT
 how do i edit a recoed in ado
when a record is opened using ADO, if you intend to edit
it, you MUST be sure to open it using the Cursor Type and  
LockType parameters:

cursorType:=adOpenDynamic, LockType:=adLockOptimistic

the recordset is then opened ALREADY in EDIT mode, there
is no need to explictly indicate that you wish to edit the
record, to change the field values.  You then use
the .Update method to save the record back to the
underlying table.  If you have not used the indicated
LockType, then the Update will trhow a run-time error.

If you are adding a New record, use the >AddNew method,
BEFORE editting the fields of the new record, then
use .Update to save the NEW record to the database.

Arthur Wood

Quote:
>-----Original Message-----
>There is no edit operation but only an editmode constant
that only gives the
>status of the edit.
>So how do i edit a record?

>.



Mon, 19 Apr 2004 01:23:20 GMT
 how do i edit a recoed in ado
Hi,

Quote:
> when a record is opened using ADO, if you intend to edit
> it, you MUST be sure to open it using the Cursor Type and
> LockType parameters:

> cursorType:=adOpenDynamic, LockType:=adLockOptimistic

This is utterly nonsense. You can have an updatable recordset opening it as
adOpenForwardOnly or adOpenKeyset, and you can also have your locktype set
to adLockPessimistic.

Whenever you open a clientside cursor, by the way, you will never get
anything else then adOpenStatic and clientside cursors are the best way to
work with a SQL server database anyways.

The best combination, as far as I know to do a simple update is, to open the
recordset as: CursorLocation=adUseClient, CursorType=adOpenStatic and
LockType=adLockOptimistic.

Evert
--
=======================================
My email address has been altered to
avoid unwanted email.

Replies to the newsgroup only, please.

Thanks,
Evert Timmer:
Transworld Software
VC++, VB6, SQL Server Database Solutions
http://www.transworld-software.com (under construction)
=======================================


Quote:
> when a record is opened using ADO, if you intend to edit
> it, you MUST be sure to open it using the Cursor Type and
> LockType parameters:

> cursorType:=adOpenDynamic, LockType:=adLockOptimistic

> the recordset is then opened ALREADY in EDIT mode, there
> is no need to explictly indicate that you wish to edit the
> record, to change the field values.  You then use
> the .Update method to save the record back to the
> underlying table.  If you have not used the indicated
> LockType, then the Update will trhow a run-time error.

> If you are adding a New record, use the >AddNew method,
> BEFORE editting the fields of the new record, then
> use .Update to save the NEW record to the database.

> Arthur Wood

> >-----Original Message-----
> >There is no edit operation but only an editmode constant
> that only gives the
> >status of the edit.
> >So how do i edit a record?

> >.



Mon, 19 Apr 2004 02:23:21 GMT
 how do i edit a recoed in ado
Thanx for your help.
really appretiated!
arshish


Quote:
> Hi,

> > when a record is opened using ADO, if you intend to edit
> > it, you MUST be sure to open it using the Cursor Type and
> > LockType parameters:

> > cursorType:=adOpenDynamic, LockType:=adLockOptimistic

> This is utterly nonsense. You can have an updatable recordset opening it
as
> adOpenForwardOnly or adOpenKeyset, and you can also have your locktype set
> to adLockPessimistic.

> Whenever you open a clientside cursor, by the way, you will never get
> anything else then adOpenStatic and clientside cursors are the best way to
> work with a SQL server database anyways.

> The best combination, as far as I know to do a simple update is, to open
the
> recordset as: CursorLocation=adUseClient, CursorType=adOpenStatic and
> LockType=adLockOptimistic.

> Evert
> --
> =======================================
> My email address has been altered to
> avoid unwanted email.

> Replies to the newsgroup only, please.

> Thanks,
> Evert Timmer:
> Transworld Software
> VC++, VB6, SQL Server Database Solutions
> http://www.transworld-software.com (under construction)
> =======================================



> > when a record is opened using ADO, if you intend to edit
> > it, you MUST be sure to open it using the Cursor Type and
> > LockType parameters:

> > cursorType:=adOpenDynamic, LockType:=adLockOptimistic

> > the recordset is then opened ALREADY in EDIT mode, there
> > is no need to explictly indicate that you wish to edit the
> > record, to change the field values.  You then use
> > the .Update method to save the record back to the
> > underlying table.  If you have not used the indicated
> > LockType, then the Update will trhow a run-time error.

> > If you are adding a New record, use the >AddNew method,
> > BEFORE editting the fields of the new record, then
> > use .Update to save the NEW record to the database.

> > Arthur Wood

> > >-----Original Message-----
> > >There is no edit operation but only an editmode constant
> > that only gives the
> > >status of the edit.
> > >So how do i edit a record?

> > >.



Sat, 01 May 2004 11:27:52 GMT
 how do i edit a recoed in ado
Thanx for ur help
arshish


Quote:
> when a record is opened using ADO, if you intend to edit
> it, you MUST be sure to open it using the Cursor Type and
> LockType parameters:

> cursorType:=adOpenDynamic, LockType:=adLockOptimistic

> the recordset is then opened ALREADY in EDIT mode, there
> is no need to explictly indicate that you wish to edit the
> record, to change the field values.  You then use
> the .Update method to save the record back to the
> underlying table.  If you have not used the indicated
> LockType, then the Update will trhow a run-time error.

> If you are adding a New record, use the >AddNew method,
> BEFORE editting the fields of the new record, then
> use .Update to save the NEW record to the database.

> Arthur Wood

> >-----Original Message-----
> >There is no edit operation but only an editmode constant
> that only gives the
> >status of the edit.
> >So how do i edit a record?

> >.



Sat, 01 May 2004 11:29:06 GMT
 
 [ 6 post ] 

 Relevant Pages 

1. ADO thinks DBMS is done, but DBMS ain't done

2. Doing a datavalidation on insert end edit, how?

3. Edit Mode - What am I doing wrong?

4. Freaky error when doing an Edit

5. Which is best to add new recoed in database ..recordset object or connection obj

6. ? Bug Tracking Database done in ASP/ADO ?

7. ADO and SQL: what am I doing wrong ?

8. doing ado using vbscript

9. ADO Update the Database with the modify done on a disconnected recordset in background mode

10. ADO update doing strange things

11. ADO update doing strange things

12. Catching a RAISERROR from ADO, anyone done it?


 
Powered by phpBB® Forum Software