Hello All
Microsoft JET Database Engine (0x80004005)
Could not use ''; file already in use.
/Includes/functions.asp, line 215
What I'm doing (well trying at least) is having two ADO connections to
the access database to fill in a dropdown list. I tried putting the
categories result in a dynamic array and closing the connection to the
database before getting the subcategories, but that resulted in the same
error (yes I did make sure that I used the .Close method)
I am greatful for any help
Al
---
Set objRSCategory = Server.CreateObject("ADODB.Recordset")
Set objRSSubCategory = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT DISTINCT category FROM products"
objRSCategory.Open strSQL, strConnect, adOpenStatic, adLockOptimistic,
adCmdText
%>
<form action="/displayItems.asp?startPage=1" method="post">
<select name="allItems">
<%
If (objRSCategory.RecordCount <> 0) Then
While (NOT objRSCategory.EOF)
strDashes = ""
For i = 0 To len(objRSCategory("category")) * 2
strDashes = strDashes & "-"
Next
%>
<option value="<%= objRSCategory("category")%>"><%= objRSCategory
("category")%></option>
<option value=""><%= strDashes %></option>
<%
strSQL = "SELECT DISTINCT subCategory FROM products WHERE Category='" & _
objRSCategory("category") & "'"
<Line 215 here:>objRSSubCategory.Open strSQL, strConnect, adOpenStatic,
adLockReadOnly, adCmdText
If (objRSSubCategory.RecordCount <> 0) Then
While (Not objRSSubCategory.EOF)
%>
<option value="<%= objRSSubCategory("subCategory")%>">
<%= objRSSubCategory("subCategory")%></option>
<%
objRSSubCategory.MoveNext
Wend
End If
%>
<option value=""></option>
<%
objRSSubCategory.Close
objRSCategory.MoveNext
Wend
End If
objRSCategory.Close
Set objRSCategory = Nothing
%>