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


Reply With Quote

Bookmarks