|
 |
asp_web_howto thread: Recordset update without form???
Message #1 by simon@h... on Tue, 19 Nov 2002 14:44:02
|
|
Is it possible to update a recordset without using a form on a page.? I
have 2 recordsets that have 2 of the same fields in each of them which
is "Project_ID" and "Status". I set 4 variables equal to the two fields in
each recordset.
I then check to see if the "Project_Id" variables match if they do I then
check the 2 "Status" variables against each other, if they dont match I
want to update the recordset with the correct value form the other
recordset. How do I do this without using a form and is it possible.
Message #2 by Imar@S... on Tue, 19 Nov 2002 17:11:47
|
|
Yes, you can. There is no need for a user interface (ie a form) to update
records in a recordset.
Persoanlly, I would issue an UPDATE statement against an open a
connection, like this:
objConnection.Execute("UPDATE MyTable SET MyField = '" & myVar & "' WHERE
ID = " & iID)
Depending on how you have set up your things, this should be the fastest
way to do it.
You could also update each value in the second recordset and then use its
Update method to write the changes to the database.
HtH,
Imar
> Is it possible to update a recordset without using a form on a page.? I
h> ave 2 recordsets that have 2 of the same fields in each of them which
i> s "Project_ID" and "Status". I set 4 variables equal to the two fields
in
e> ach recordset.
> I then check to see if the "Project_Id" variables match if they do I
then
c> heck the 2 "Status" variables against each other, if they dont match I
w> ant to update the recordset with the correct value form the other
r> ecordset. How do I do this without using a form and is it possible.
|
|
 |