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

Html or ASP page stucking up

Status
Not open for further replies.

Aqif

Programmer
Apr 27, 2002
240
AU
Hi..I am just trying to save the data through Htmls form and after submitting the values the page1.htm on my browser just stuck and do nothing. I will really appreciate that you experts please look into my simple code and point out if I am doing something wrong

'Code for Page1.htm

<html>
<Body>
<form method=&quot;POST&quot; action=&quot;save.asp&quot; >
Input 1:<input type=&quot;text&quot; name=&quot;Input1&quot;>
Input 2:<input type=&quot;text&quot; name=&quot;Input2&quot;>
Input 3:<input type=&quot;text&quot; name=&quot;Input3&quot;><br>
<input type=&quot;submit&quot; value=&quot;Submit&quot;>
</form>
</Body>
</Html>

'Code for save.asp

<%
Option Explicit
Dim sql
Dim oRS
Dim oConn, sConnString
Set oConn = Server.CreateObject(&quot;ADODB.Connection&quot;)
sConnString = &quot;DRIVER={Microsoft Access Driver (*.mdb)};&quot; & _
&quot;DBQ=&quot; & Server.MapPath(&quot;\myusername\db\db2.mdb&quot;) & &quot;;&quot;
oConn.Open(sConnString)
sql = &quot;INSERT INTO Table1 (id1, Name, Phone) VALUES ('&quot;
& request.form(&quot;Input1&quot;) & &quot;', '&quot; & request.form(&quot;Input2&quot;) & &quot;', '&quot; &
request.form(&quot;Input3&quot;) & &quot;'&quot;
Set oRS = oConn.Execute(sql)

oConn.Close

Set oRS = Nothing
Set oConn = Nothing

Response.Write(&quot;<font size=3 face=arial>&quot;)
Response.Write(&quot;<b>Values Saved</b><br><br>&quot;)
%>


I know that probably its not nice to ask you for such basic help but I am really desperate and just need a start.

Cheers!
Aqif

 
you're missing a ) first

sql = &quot;INSERT INTO Table1 (id1, Name, Phone) VALUES ('&quot;
& request.form(&quot;Input1&quot;) & &quot;', '&quot; & request.form(&quot;Input2&quot;) & &quot;', '&quot; & request.form(&quot;Input3&quot;) & &quot;'&quot;

end like this
'&quot; & Request.Form(&quot;Input3&quot;) & &quot;')&quot;
Also get in teh habit of uppercase on the Request and the Form


I may not get it the 1st or 2nd time,
but how sweet that 15th time can be.
 
Dear onpnt :)

I really appreciate your help and ur modification worked like a charm :) Shouldn't have tried it by myself for atleast 15 times and then would have bothered u :) any how thanxx mate :)

Cheers!
Aqif
 
That's why I come here Aqif, I like to help out when I can and I'm glad I did.
Happy Programming I may not get it the 1st or 2nd time,
but how sweet that 15th time can be.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top