Results 1 to 9 of 9

Thread: 500 Internal Server Error

  1. #1
    Join Date
    Apr 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default 500 Internal Server Error

    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

  2. #2
    Join Date
    Feb 2007
    Location
    🌎
    Posts
    528
    Thanks
    10
    Thanked 10 Times in 10 Posts
    Blog Entries
    2

    Default

    Hmm... I've seen several of those at PuzzleMaker. And it just happened to be written in ASP. Weird. Can't help you there.
    ....(o_ Penguins
    .---/(o_- techno_racing
    +(---//\-' in
    .+(_)--(_)' The McMurdo 500

  3. #3
    Join Date
    Sep 2005
    Location
    India
    Posts
    1,627
    Thanks
    6
    Thanked 107 Times in 107 Posts

  4. #4
    Join Date
    Apr 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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..

  5. #5
    Join Date
    Sep 2005
    Location
    India
    Posts
    1,627
    Thanks
    6
    Thanked 107 Times in 107 Posts

    Default

    Can you provide the code that you are using.

  6. #6
    Join Date
    Apr 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    This is the asp code. Check for html code below

    <&#37;@ Language="VBScript" %>
    <% Option Explicit %>
    <html>
    <head>
    <title>Form to database</title>
    </head>
    <body>
    <%
    '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
    connection.Open(sConnString)

    'execute the SQL
    connection.execute(sSQL)

    response.write "The form information was inserted successfully."
    'Done. Close the connection object
    connection.Close
    Set connection = Nothing
    %>
    </body>
    </html>






    And this is the rather simple html code..


    <html>
    <head>
    <title>Form to Database</title>
    </head>
    <body>
    <!-- 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">
    <tr>
    <td>Name :</td>
    <td><input type="text" name="name"></td>
    </tr>
    <tr>
    <td>Email :</td>
    <td> <input type="text" name="email"></td>
    </tr>
    <tr>
    <td>Comments :</td>
    <td><textarea name="comments"></textarea></td>
    </tr>
    <tr>
    <td>&nbsp;</td>
    <td><input type="submit" value="submit details" name="submit"></td>
    </tr>
    </table>
    </div>
    </form>
    <!-- end the HTML form-->
    </body>
    </html>

  7. #7
    Join Date
    Sep 2005
    Location
    India
    Posts
    1,627
    Thanks
    6
    Thanked 107 Times in 107 Posts

    Default

    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

    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

    Code:
    sConnString="Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("users.mdb")& ";"
    save the files and try it

  8. #8
    Join Date
    Apr 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I get an error as follows

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

  9. #9
    Join Date
    Sep 2005
    Location
    India
    Posts
    1,627
    Thanks
    6
    Thanked 107 Times in 107 Posts

    Default

    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.

    http://www.webwizguide.info/asp/faq/...ermissions.asp

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •