|
-
Jun 15th, 2001, 09:36 AM
#1
Thread Starter
Hyperactive Member
Update Statement
Hi All,
I have a form that i populate using the id on the selected row:
Once i have edited the data i want to use an update statement or what ever is suitable to update the currently selected row. The form is populated using the filed name to put the currently held value in, once edited, i would like to update but i'm having problem getting the right update statement from the form... does anyone have an example or a solution to this problem.??
Many thanks Gary
"Life isn't about finding yourself. Life is about creating yourself."
--George Bernard Shaw
-
Jun 15th, 2001, 10:56 AM
#2
Frenzied Member
You'll need to build the update query string in code from your Request.Form() variables on the page the form is submitted to.
Something to the tune of:
Code:
strSQL = "Update tablename (field1, field2, field3,...) values(" & Request.Form("Field1") & ", " & Request.Form("Field2") & ", " & Request.Form("Field3") & ")"
Now, if any of these fields are strings, you will need to put single quotes 'around them':
Code:
strSQL = "Update tablename (field1, field2, field3,...) values('" & Request.Form("Field1") & "', '" & Request.Form("Field2") & "',' " & Request.Form("Field3") & "')"
Then just feed it to your Connection object's Execute method:
Code:
cnConn.Execute strSQL
oOOo--oOOo
__ /\/\onte96
oOOo--oOOo
Senior Programmer/Analyst
MCP
[email protected]
[email protected]
Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..
-
Jun 18th, 2001, 04:26 AM
#3
Thread Starter
Hyperactive Member
Cheers, i'll give it a whirl.
"Life isn't about finding yourself. Life is about creating yourself."
--George Bernard Shaw
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|