View Full Version : 500 Internal Server Error

04-20-2007, 11:13 AM
Hi I'm quite new to ASP and I'm stuck. Basically I'm loading data into a database from a form. This works perfectly in the localhost but once I move onto the live site and upload it it gives me a 500 Internal Server Error.. (quite vague lol)

I tried to make this error more specific by changing the value in the Tools/Internet Options/Advanced tab. I also changed this setting on IIS (Home Directory/Configuration).. Still no luck!! The worst bit is that the server is located in another site and its difficult to get at these people.. Any help would be really good.. For instance if someone could tell me exactly what settings I should make in the server it would be great!! Thanks

04-21-2007, 02:53 AM
Hmm... I've seen several of those at PuzzleMaker (http://www.puzzlemaker.com). And it just happened to be written in ASP. Weird. Can't help you there.

04-23-2007, 03:18 AM
Have a look at these articles


04-23-2007, 04:20 AM
Thanks for the replys guys.. Actually I've seen both the sites you suggested codeexploiter. I tried it but no difference in the error. The worst thing is it works in localhost but not on the live site..

04-23-2007, 05:11 AM
Can you provide the code that you are using.

04-23-2007, 06:21 AM
This is the asp code. Check for html code below

<&#37;@ Language="VBScript" %>
<% Option Explicit %>
<title>Form to database</title>
'declare your variables
Dim name, email, comments
Dim sConnString, connection, sSQL
'Receiving values from Form, assign the values entered to variables
name = Request.Form("name")
email = Request.Form("email")
comments =Request.Form("comments")

'declare SQL statement that will query the database
sSQL = "INSERT into users_tbl (name, email, comments) values ('" & name & "', '" & email & "', '" & comments & "')"
'define the connection string, specify database
'driver and the location of database
sConnString="PROVIDER=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & Server.MapPath("users.mdb")
'create an ADO connection object
Set connection = Server.CreateObject("ADODB.Connection")

'Open the connection to the database

'execute the SQL

response.write "The form information was inserted successfully."
'Done. Close the connection object
Set connection = Nothing

And this is the rather simple html code..

<title>Form to Database</title>
<!-- comment - start the HTML form and use a HTML table for formatting-->
<form name="form1" action="quiz.asp" method="post">
<div align="center">
<table width="80%" border="0">
<td>Name :</td>
<td><input type="text" name="name"></td>
<td>Email :</td>
<td> <input type="text" name="email"></td>
<td>Comments :</td>
<td><textarea name="comments"></textarea></td>
<td><input type="submit" value="submit details" name="submit"></td>
<!-- end the HTML form-->

04-23-2007, 08:10 AM
As you said your code is working without any problem.

Have your tried any database connection method other than OLE DB. Specifically have you tried the following:

(1) ODBC based method (Data Source Name - DSN method)
(2) DSN Less connection method

Comment the following line in your code

sConnString="PROVIDER=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & Server.MapPath("users.mdb")

Insert this code just after the above line in your source code - This one is a DSN less method. Just want to know whether this one works for you

sConnString="Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("users.mdb")& ";"

save the files and try it

04-23-2007, 08:21 AM
I get an error as follows

Error Type:
Microsoft JET Database Engine (0x80004005)
Operation must use an updateable query.
/quiz.asp, line 29

04-23-2007, 08:29 AM
I think you don't have sufficient privileges for inserting the record(s) into the database you are referring in your code.

As you've mentioned the code works correctly even in my PC too because we have sufficient privileges to insert the data into the database but unfortunately your web host hasn't set enough permissions for you to do the insertion.

Read this article in which they've explained how you can set permission in your resources.