troubleshooting Question

Recordset refresh problem

Avatar of georgehayes3
georgehayes3 asked on
Visual Basic ClassicASPVB Script
9 Comments1 Solution274 ViewsLast Modified:
I have 2 problems...

1. I have a page with a recordset from an MS access database displaying fields in a table in an iframe

in the table is a delete link.  When the delete link is clicked another page opens in the same frame with the record id passed. Everything works fine and the db record is deleted.  I then reopen the original page and the deleted record is still showing in the page.  It appears the recordset or table contents is not refreshing.

here is the code:

<html>
<head>
<%
set asplObj=Server.CreateObject("ASPL.Login5")

'You can protect this page to a number of different users
'asplObj.User("user1")
'asplObj.User("user2")
'asplObj.User("user3")

'Or, you can protect this page to a number of different groups
'asplObj.Group("group1")
'asplObj.Group("group2")
'asplObj.Group("group3")

asplObj.Protect


Dim selectedid
selectedid = Request.Querystring("idpass")

%>
<BODY>

<%
    Dim connStr
    connStr = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("Data\Compliance\FileDB.mdb")
    Set rs = Server.CreateObject("ADODB.Recordset")
    ShowSQL = "SELECT * FROM qryFiles WHERE [ID] =" & selectedid
            
    ' opening connection
    rs.Open ShowSQL, connStr, 3, 4


%>
<BR>
<%response.write "Standard: " & rs("Standard")%>

<%response.write "-" & rs("SubStd")%>
<BR>
<%response.write "File: " & rs("File Name")%>
<BR>
<BR>
<BR>
<%
   rs.Close
   Set rs = Nothing
   
   
    connStr = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("Data\Compliance\FileDB.mdb")
    Set rs = Server.CreateObject("ADODB.Recordset")
    ShowSQL = "SELECT * FROM qryFiles WHERE [ID] =" & selectedid
            
    ' opening connection
    rs.Open ShowSQL, connStr, 1, 3
    rs.delete
    rs.update
    rs.Close
    Set rs = Nothing
   
   response.write "File Deleted..."
   %>
<BR>
<a href="show.asp?stdpass=1.1.1">Back</a>
</BODY>

2. When the browser is completely shutdown, the ldb file does not go away.  I cant seem to close the connection using connStr.close because the browser then yells at me like this:

Microsoft VBScript runtime error '800a01a8'

Object required: 'Provider=Microsoft.J'

/testpd/Y2008/CFileDel.asp, line 59


if i take it out it works fine.  but the connection doesnt get closed nicely like it should.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 9 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 9 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros