PLz help i am trying to design a basic asp which include 3 page of asp file.
1.name.asp -which let ppl key in their name & gender
2.view.asp-View the input field from the name.asp and when click submit mean the page will go in to the display.asp
3. Display.asp- display a message to inform the ppl tht their data already been store.
But after my page run till display.asp some error will show on the browser page which is...
9/29/2003 11:09:16 AMNo update permissionSyntax error in INSERT INTO statement.
Below i include my display.asp part n my view.asp
--view.asp--
<p>Name:
<%response.write(request.form("txtname"))%>
<br>
Gender:
<%response.write(request.form("txtsex"))%>
</p>
<p> </p>
<form name="form1" method="post" action="display.asp">
<input type="submit" name="Submit" value="Submit">
<input type="reset" name="Submit2" value="Reset">
</form>
--display.asp--
<%
response.write(Now())
%>
<%
dim sql
dim conn
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "C:\Host\demo\demo.mdb"
txtname =replace(txtname,"'","''")
txtsex =replace(txtsex,"'","''")
sql="INSERT INTO tblUsers (Usernames,Gender)"
sql=sql & "VALUES"
on error resume next
conn.Execute sql,recaffected
if err<>0 then
Response.Write("No update permission" & err.description)
else
Response.Write("<h3>" & recaffected & " record added</h3>")
end if
Set sql = Nothing
conn.close
%>
<p><a href="name.asp">Back</a></p>
<table width="90%" border="0">
<tr>
<td width="11%"> </td>
<td width="89%"> </td>
</tr>
<tr>
<td> </td>
<%
dim rsSex
dim cnSex
dim strDBPath
set cnSex=server.CreateObject("adodb.connection")
set rsSex=server.CreateObject("adodb.recordset")
strDBPath = Server.MapPath("demo.mdb")
'cnSex.open "c:/Host/demo/demo.mdb"
cnSex.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & ";"
'rsSex = "SELECT * FROM tblUsers "
Set rsSex = cnSex.Execute("SELECT * FROM tblUsers")
%>
<%
do while not rsSex.EOF
response.Write"<td>" & rsSex("Gender"& err.description)&"</td>"
rsSex.movenext
loop
rssex.close
set rssex = nothing
cnSex.Close
set cnSex = nothing
%>
</tr>
</table>
please help.thanks