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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

what is wrong with this form request?

Status
Not open for further replies.

phentalmyst

Programmer
Jan 30, 2001
18
0
0
US
hi all,

ive tried and tried to pull this form entry into a database update and it just wont work. if i take the variable "ns" and make it an actual text string, the update works fine...but if i use a "request.form("theformobjectnamehere") it wont pull. please help! thanks! here's my code:

<%@ LANGUAGE = VBScript %>
<html>

<head>
<title>moongroover editor</title>

<%
Dim DataConn
Dim CmdUpdateRecord
Dim MYSQL
Dim ns
Dim edited

Set DataConn = Server.CreateObject(&quot;ADODB.Connection&quot;)
Set CmdUpdateRecord = Server.CreateObject(&quot;ADODB.Recordset&quot;)

DataConn.Open &quot;DBQ=&quot; & Server.Mappath(&quot;../data/bios.mdb&quot;) & &quot;;Driver={Microsoft Access Driver (*.mdb)};&quot;


edited = request.querystring(&quot;groover&quot;)
ns = request.form(&quot;instruments&quot;)

MYSQL = &quot;SELECT instruments FROM bios WHERE groover=&quot;&edited

CmdUpdateRecord.Open MYSQL, DataConn, 1, 3

CmdUpdateRecord.Fields(&quot;instruments&quot;) = ns
CmdUpdateRecord.Update

CmdUpdateRecord.Close
Set CmdUpdateRecord = Nothing
DataConn.Close
Set DataConn = Nothing
%>

</head>

<body>
<center>Good job <%=edited%>!!</center><br><br><%=ns%>
</body>
</html>
 
I'm not entirely certain what you're trying to do, but request.form and request.querystring are different ways to get info back from a submitted page. Use form if sending by &quot;Post&quot; and use Querystring if sending by &quot;Get&quot;. These are both ways to get info back from your <input> items, but I don't believe you can use both in the same page. If you're are getting info back in request.querystring, you can place your &quot;name=&quot;instruments&quot;&quot; input outside of a &quot;form&quot; section and have it returned in the querystring. Otherwise, put your &quot;name=groover&quot; input inside the form (with the instrument input) and use a submit input to send them both in the request.form string.

I don't know if I'm being clear, but hopefully this gets you a little less stuck. Let me know if you'd like more elaboration.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top