SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Mar 2011
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Error number 3704

    Hi everyone,
    I am new in ASP, can you please help me or give me some hints to solve my error. Thank you in advance.

    I have a simple page in ASP, the page is to write data to a MS Access database file.

    the test file works perfectly on my intranet (local server) but not on my webserver and give the error message as following:
    Error Number 3704
    Error Description Operation is not allowed when the object is closed.
    Source ADODB.Connection




    <%@LANGUAGE="VBSCRIPT"%>

    'turn error-handling on:
    On Error Resume Next

    'Declare variables
    Dim sql_string
    Dim order_form
    Dim thanks_page
    Dim db_connection
    Dim db_connection_string


    db_connection_string = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Inetpub\vhosts\123\httpdocs\Forms\Database\test.mdb;"


    Set db_connection = Server.CreateObject("ADODB.Connection")
    db_connection.Open db_connection_string


    'Redirect pages
    order_form = "http://123/Forms/test/test_form.asp"


    sql_string="INSERT INTO test(name)"
    sql_string=sql_string & " VALUES "
    sql_string=sql_string & "('" & Request.Form("name") & "')"

    db_connection.Execute sql_string


    IF Err<>0 then %>
    Error description:
    <% response.write err.description %>
    <BR>Error number:
    <% response.write err.Number %>
    <BR>Error source:
    <% response.write err.Source %>
    <BR>Line number:
    <%= Err.Line %>

    <% response.end

    ELSE
    Response.Redirect(thanks_page)
    END IF


    db_connection.close

    %>

  2. #2
    SitePoint Addict
    Join Date
    Apr 2009
    Posts
    357
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Comment out the 'on error resume next statement and you should then see the actual error message.
    Doug G
    =====
    "If you ain't the lead dog, the view is always the same - Anon

  3. #3
    SitePoint Addict itHighway's Avatar
    Join Date
    Jan 2008
    Location
    GUJ
    Posts
    270
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Check you database path.

  4. #4
    SitePoint Member
    Join Date
    Mar 2011
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you Doug G and itHighway,

    My database path is correct and I took out the "on error resume next" statement but the error still the same:

    Error Number: 3704
    Error Description: Operation is not allowed when the object is closed.
    Source: ADODB.Connection

    Actually the form did work perfectly before.
    After the web server was updated, all my online forms have the same errors as the above. The code I posted is an example of all my forms.

    I am crying for help. thanks a lot.

  5. #5
    SitePoint Addict
    Join Date
    Apr 2009
    Posts
    357
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    The error message is created by your code and isn't the generic 500 error that IIS normally generates, which also gives you a line number. Maybe IIS didn't clean out the page cache and you're still running with the active "on error resume next" error trap.

    PS - you should review how error trapping works in classic asp (it's very poor). If you don't test err after every statement you can easily never see an error. I recommend you only enclose a single code line in an on error resume next, test err, then immediately issue on error goto 0 to turn error trapping back off.
    Doug G
    =====
    "If you ain't the lead dog, the view is always the same - Anon


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
  •