Add New,Update Vs. Execute ?? - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Add New,Update Vs. Execute ??

Benny_ABenny_A Posts: 1Member
I use two common method to insert, update or delete records on database, they are
[code]
//rs is adodb.recordset
rs.addnew
rs!Id = text1.text
rs!Name = .....
..
.
rs.update
[/code]
AND
[code]
//db is adodb.connection
db.execute()
[/code]

the Qustions are :
which one do you think the best to use???
why you choose it??
any other simple&powerful method to doing this??

Thanks

Comments

  • Termc1224Termc1224 Posts: 84Member
    : I use two common method to insert, update or delete records on database, they are
    : [code]
    : //rs is adodb.recordset
    : rs.addnew
    : rs!Id = text1.text
    : rs!Name = .....
    : ..
    : .
    : rs.update
    : [/code]
    : AND
    : [code]
    : //db is adodb.connection
    : db.execute()
    : [/code]
    :
    : the Qustions are :
    : which one do you think the best to use???
    : why you choose it??
    : any other simple&powerful method to doing this??
    :
    : Thanks
    :
    Execute require you to create a stored procedure in SQLserver and just call it anytime and much faster than new, update. but if you do not know how to create a stored procedure then use new, update.
  • junjiecutejunjiecute Posts: 4Member
    I think the difference between the add new, UPdate is the execution of information. Here is what I mean

    when you do...
    with rs
    .addnew
    .fields(0) = "x"
    .update
    end with

    It process the data through the client then request update from the server since you are using the ADO control. It uses your Physical memory.


    And when you do...

    rs.execute()

    It requests the SQL to be processed server side since you are passing the whole request into the server without having it processed through the control.

    Correct me if I am wrong but this is how I understand this.

    ^_^
Sign In or Register to comment.