PDA

View Full Version : Need help on solutions to Error code 405 in pws!!!


wanye
04-03-2003, 11:02 AM
hi.. how do solve : HTTP Error 405
405 Method Not Allowed
The method specified in the Request Line is not allowed for the resource identified by the request. Please ensure that you have the proper MIME type set up for the resource you are requesting.
Please contact the server's administrator if this problem persists.

i need to know whats the problems causing this error and what are the solutions to solve this? thx..

raf
04-03-2003, 02:00 PM
Think we also need to know what causes it before we can help you;)
Can you give us some code or info. Do you get this on each page?

wanye
04-03-2003, 02:29 PM
the code is shown below.. once i click "send", e error will appear..

<%@ Language=VBScript %>
<HTML><HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>

<%

Set conn = Server.CreateObject("ADODB.Connection")
set rs = server.CreateObject("ADODB.Recordset")

conn.Provider = "Microsoft.Jet.OLEDB.4.0"
conn.ConnectionString = "Data Source=" & Server.MapPath("database.mdb")
conn.Open

sSQL = "Insert into UserLogin (EMail, Pass, FirstName, LastName, Address, HomeNo, HPNo, ICNo) Values" & _
"('"& Request.Form("email") & Request.Form("pass") & Request.Form("fname") & Request.Form("lname") & Request.Form("addr") & Request.Form("homeph") & Request.Form("hp") & Request.Form("ic") & "')"

conn.Execute sSQL,adCmdText

on error resume next
conn.Execute sql, recaffected
if err<>0 then
Response.Write("Values are different from the declared type or no update permissions!")
else
Response.Write("<h3>" & recaffected & " record added</h3>")
end if
conn.close

%>

<h2>Your login details have been saved to the database<h2>
<A HREF="login.asp">[Click here to go to login page]</A>
</BODY>
</HTML>

raf
04-04-2003, 08:40 AM
for starters, the sql statement cant be right.

Add this just before the "conn.Execute sSQL,adCmdText" line and you'll see what i mean

response.write sSQL
response.end

This will print the sql string to the browser. In a correct statement, the values should look like this:
VALUES('text1',number1,number2, number3,'text2')

Your part will look like
VALUES('text1number1number2number3text2')

I alway do this

sSQL="Insert into UserLogin (EMail, Pass, FirstName, LastName, Address, HomeNo, HPNo, ICNo) VALUES('text1',number1,number2, number3,'text2')"
SSQL=replace(sSQL,"text1",replace(request.form("field1"),"'","''")) 'in text values replace ' by ''
sSQL=replace(sSQL,"number1",request.form("field2"))
etc


Lot easier to debug.Check the sticky on top of this forum for the single quotes thing
(Of coarse you need to replace the text1 etc by meaningful things, like 'anemail', 'apass' etc)