Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

update after edit in ado

Status
Not open for further replies.

VBVines

MIS
Jun 11, 1999
98
0
0
US
I have a database whoose recordset fields populate several text boxes. I want to be able to edit one or more of the text boxes and hit a command button that saves the change. With DAO you used .edit followed later by .update. Does anyone know how to do it with ADO since .edit isn't supported with ADO. Has anyone ever used DAO in the same program with ADO. Thanks, aspvbwannab
 
with rsYourRecordset
!Yourfield = text1
.update
end with

Thats all there is to it. You just don't need to use the .edit. Also to note that if you do change a field in your recordset you must either do a .update to commit the change or a .cancelupdate to abort the change otherwise you cannot close the recordset.

David Paulson


 
The above method will work... but using the ! or(bang) method of accessing a database is the slowest method possible...
would be better to use .fields('YourField') = text1
.update

But you could probably use an update command with better success.
Update <Tablename> set <field> = text1
Or create a stored proc if it will always be the same table.
sp_Tablename
with params for each field and pass it all the values

Chad
tinman@thelandofoz.org

Tinman,

Welcome to OZ.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top