Update Command Code Assistance
Does anyone have the code that would allow me to click on a command button called cmdUpdate, and have that action update the records in a table called Members? I did it once on another table, but have lost the little tidbit of code I used behind the command button.
thanks
[282 byte] By [
sensei] at [2007-11-11 8:33:09]

# 1 Re: Update Command Code Assistance
It depends on which database you have what the fields are, etc...
You can use ADO to do the job, do some research on this subject and you find a solution.
# 2 Re: Update Command Code Assistance
I was hoping you could tell me how to do it.....I want to click on a command button and have it update the current database table. I did it once, but have forgotten how to do it. the database is linked with ADO already, now I want to update it by a simple click. I know it can be done. do you or can you please type the code for me?
thanks\
sensei at 2007-11-11 17:26:22 >

# 3 Re: Update Command Code Assistance
Here's a small example, you can modify it:
dim cnn as adodb.connection
dim rst as adodb.recordset
cnn.provider = ...
cnn.connectionstring = ...
cnn.open
set rst = new adodb.recordset
rst.open "select * from members where memberID=1"
rst.fields!memberID = 5
rst.fields!name = "test"
rst.update
rst.close
set rst = nothing
cnn.close
set cnn = nothing