|
|
|
|
|
| | |
|
Active Server Pages help tutorial how to ASP Help ASP Tutorials ASP Programming ASP Code - ASP Free CJWSoft ASPProtect ASPBanner ASPClassifieds
(Advanced)
(Components)
(Database)
(General)
(Vbscript)

|
|
Subject: |
updating records with values from a form |
From: |
Carl |
Date: |
2/4/2001 4:41:55 PM |
IP: |
38.221.252.52 |
I am having a problem passing info from a text box into a asp page to update a record.
here is the code I am using:
THESE ARE MY VARIABLES TO HOLD INPUT FROM THE FORM
target = CInt(Request.Form("txtiddel"))
Field = Request.Form("txtfield_Name")
NewVal = Request.Form("txtNew_Val")
THIS IS WHERE I AM TRING TO PASS THE INFO FOR AN UPDATE:
MYSQL ="SELECT * FROM NPL WHERE ID_NO = " & target & ""
CmdUpdateRecord.Open MYSQL,DataConn,1,3
CmdUpdateRecord.Fields(" & Field & ")= NewVal
CmdUpdateRecord.Update
The error I get is:
Item cannot be found in the collection corresponding to the requested name or ordinal.
/altered.asp, line 30
Line 30 is the line that reads:
CmdUpdateRecord.Fields(" & Field & ")= NewVal
I know that it is saying that there is not a column in the table called "Field". I am wondering how to pass the value from the form to the variable?
Any help would be greatly appreciated.
|
Follow Up - Re: updating records with values from a form - Ripul 2/5/2001 1:23:57 AM
|
|

|
|
|
|
|
|
|
|
|
|