Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 1st, 2007, 12:59 PM
Registered User
 
Join Date: Feb 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default MS-Access Connection denied for 1 min after Query

I'm setting up a search page for a database, and using the code below to test the script on a very simple test database. The search works great the first time. However, when I return to the search page using either "Back" on the browser, or the "Return" link on the results page and try a new search I get the following error:

Error Type:
Provider (0x80004005)
Unspecified error
/response1.asp, line 24

After about 1 minute this error clears and the new search can be performed.

How can this problem be corrected?

Any help would be much appreciated! Thanks.

<%@ LANGUAGE=VBScript %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html dir=ltr>
<HEAD>
  <TITLE>Response1.asp File</TITLE>
  <META NAME="ROBOTS" CONTENT="NOINDEX">
  <META HTTP-EQUIV="Content-Type" content="text/html; charset=Windows-1252">
</head>

<body bgcolor="#FFFFFF" text="#000000">

<H2><CENTER>Search Results Test Page</CENTER></H2>

<%
  Dim adoCon
  Dim rsGuestbook
  Dim strSQL
  Dim strName

  strName = Request.Form("Name")

  Set adoCon = Server.CreateObject("ADODB.Connection")
  adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("guestbook.mdb")
  Set rsGuestbook = Server.CreateObject("ADODB.Recordset")

  strSQL = "SELECT tblComments.Name, tblComments.Comments FROM tblComments WHERE tblComments.Name='" + strName + "';"

  Response.Write ("<BR>Searching for Name of ")
  Response.Write (strName)
  Response.Write ("<BR><BR>Found:<BR>")

  rsGuestbook.Open strSQL, adoCon

  if rsGuestbook.EOF and rsGuestbook.BOF then

    Response.Write "No Records Found"

  else

    Do While not rsGuestbook.EOF

      Response.Write ("<BR>")
      Response.Write (rsGuestbook("Name"))
      Response.Write ("<BR>")
      Response.Write (rsGuestbook("Comments"))
      Response.Write ("<BR>")
      rsGuestbook.MoveNext

    Loop

  end if

  rsGuestbook.Close
  Set rsGuestbook = Nothing
  Set adoCon = Nothing
%>

<BR>
<a href=Form1.htm>Return</a>

</BODY>
</HTML>





Similar Threads
Thread Thread Starter Forum Replies Last Post
Connection String to MS ACCESS jmss66 Classic ASP Databases 4 January 24th, 2008 06:54 PM
Connection Pool on MS Access? Edward King Java Databases 1 August 3rd, 2005 12:48 AM
ms access database connection android66 Javascript 1 December 1st, 2004 07:19 AM
Help with ASP and MS ACCESS. Connection error. patzblue Access ASP 7 September 11th, 2004 05:43 AM
Can't get connection to MS Access pekj JSP Basics 1 June 1st, 2004 04:54 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.