473,322 Members | 1,806 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

ASP error when uploaded ""An error occurred on the server when processing the URL"

Hi

I have the following code which is an ASP questionnaire using an Access
database. (I am using access as I have no choice!). Basically there is an
html form which submits the form to the page below and the code below
submits the data to the DB and redirects the user.

The code works locally on http://localhost or http://127.0.0.1 but when I
upload it to a site (I have tried a few and they all error) it says "An
error occurred on the server when processing the URL. Please contact the
system administrator."

I was thinking it may be as I am not putting the full path to the database
i.e. c:/pathname/questionnaire.mdb but as I have to FTP it and I don't have
access to the full path and cannot find out what it is.

Has anyone any ideas on what this problem is or how to overcome it?
Luke

The code is:

<% @LANGUAGE = VBScript %>
<%
Dim name, organisation, email, q1, q2
Dim connString, objConn, sql_insert_det, sql_insert_res

Set objConn = Server.CreateObject("ADODB.Connection")
connString="DRIVER={Microsoft Access Driver (*.mdb)};" & _
"DBQ=" & Server.MapPath("questionnaire.mdb") & ";"
objConn.Open(connString)

Function ChkString(string)
If string = "" Then string = " "
ChkString = Replace(string, "'", "''")
End Function

name = ChkString(Request.Form("name"))
organisation = ChkString(Request.Form("organisation"))
email = ChkString(Request.Form("email"))
q1 = ChkString(Request.Form("Financial Institution Name"))
q2 = ChkString(Request.Form("Do you use a branch"))

sql_insert_det = "insert into userdetails (name, organisation, email) values
('" & name & "', '" & organisation & "', '" & email & "')"
sql_insert_res = "insert into questionset1 (question1, question2) values ('"
& q1 & "','" & q2 & "')"
'execute the SQL
objConn.execute(sql_insert_det)
objConn.execute(sql_insert_res)

If err.number=0 Then

response.write "<span style='font-family:arial'>Thank you for completeing
the questionnaire.</span>"
Else
response.write "There was a problem entering the data!"
End If

' Done. Close the connection object
objConn.Close
Set objConn = Nothing

%>

Nov 18 '05 #1
2 5376
"Luke" wrote in message news:c5*************@ID-188416.news.uni-berlin.de...
: I have the following code which is an ASP questionnaire using an Access
: database. (I am using access as I have no choice!). Basically there is an
: html form which submits the form to the page below and the code below
: submits the data to the DB and redirects the user.
:
: The code works locally on http://localhost or http://127.0.0.1 but when I
: upload it to a site (I have tried a few and they all error) it says "An
: error occurred on the server when processing the URL. Please contact the
: system administrator."

Did you?

: I was thinking it may be as I am not putting the full path to the database
: i.e. c:/pathname/questionnaire.mdb but as I have to FTP it and I don't
have
: access to the full path and cannot find out what it is.

Response.Write(Request.ServerVariables("PATH_TRANS LATED"))

This will give you the physical path to the script. You can figure it out
from there.

: connString="DRIVER={Microsoft Access Driver (*.mdb)};" & _
: "DBQ=" & Server.MapPath("questionnaire.mdb") & ";"

Server.MapPath only references the path under the web root. Your database
should be located in an area not accessible virtually.

\db
\db\questionnaire.mdb
\webroot
\webroot\default.asp

If your db is in the area similar to the above, using the PATH_TRANSLATED
will give you the physical path. If it were:
d:\inetpub\domainname\webroot then your physical path to your db would be:
d:\inetpub\domainname\db

HTH...

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
Nov 18 '05 #2
> to one of the problem pages and sprinkle

if err.number <> 0 then
response.write err.description
response.end
end if

into your code until you find the line that is erroring.


Thanks for the reply I have done as you suggested and found out it is
because there is not write access to the folder, so your debugging example
really helped.

I have therefore contacted my host in regard to this

Luke
Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Luke | last post by:
Hi I have the following code which is an ASP questionnaire using an Access database. (I am using access as I have no choice!). Basically there is an html form which submits the form to the page...
2
by: VB Programmer | last post by:
I created a ASP.NET app locally and it works great. Uploaded it to my server and I get this error when trying to view a page. Any ideas? Server Error in '/earlyalert3' Application....
1
by: platinumbay | last post by:
Sometimes when I run or build (or save I think) one of several VB .NET CE applications I get the above error. I then get a 'save file as' option to change the 'myapp.vbdproj' file. If you keep the...
10
by: Rider | last post by:
Hi, simple(?) question about asp.net configuration.. I've installed ASP.NET 2.0 QuickStart Sample successfully. But, When I'm first start application the follow message shown. ========= Server...
0
by: Peter Bromberg [C# MVP] | last post by:
Recently another developer I work with and I were discussing ways to log more information than just the stock event log entry when an app blows up because of an unhandled exception. There were a...
0
by: Archana Kumar | last post by:
Hi, I try to open a Boa Constructor's instance when an error message : "No section:editor" (in a pop up window) is being thrown. I can see on the console that the last message shown is "running...
0
by: DC | last post by:
The problem I'm using the .NET GridView and FormView objects for the first time and im getting the error "An OleDbParameter with ParameterName '@ID' is not contained by this...
5
by: Cirene | last post by:
I just deployed my new ASP.NET (3.5 FW) site to the hosting company I'm using, webhost4life. NOTE: I HAVE deployed other SQL Server sites to the same account with no issues. Now I'm getting...
6
by: Bobby Edward | last post by:
Using ASP.NET 3.5 and MySQL (thru DevArt MyDirect.NET)... On the production server I get a "Parser Error" for every XSD dataset. It works perfect on my dev machine. But, on the production...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.