p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

proasp_codeclinic thread: FW: Help


Message #1 by Derek Armitage <darmitage@w...> on Mon, 26 Mar 2001 17:05:48 +1200
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C0B5F8.F18D6ECE
Content-Type: text/plain;
	charset="iso-8859-1"

Some program has a table open for exclusive use.  I get this message when I
am testing a page that tries to query a table I have open in Access.  If I
close the table, the error does not occur.  I didn't review your code, so
this is just what I would check first.

- George Draper

-----Original Message-----
From: Derek Armitage [mailto:darmitage@w...]
Sent: Monday, March 26, 2001 12:06 AM
To: Code Clinic
Subject: FW: Help




>  -----Original Message-----
> From: 	Derek Armitage  
> Sent:	Monday, 26 March 2001 16:59
> To:	'proasp_codeclinic@p...'
> Subject:	Help
> 
> Hi team
> 
> Can you help with this error?
> 
> Microsoft JET Database Engine error '80004005' 
> Could not use ''; file already in use. 
> /crk1/main.asp, line 196 
> 
> '---------------------------------------------
> 'brand section
> Dim rs_brand
> 'Dim query_b
> %>
> <td valign="top" width="10%" align="left">
> <p><img align="left" height="1000" src="menu_files/blackline.gif"
> width="3">
> <img src="menu_files/title-topbrands.gif" WIDTH="150" HEIGHT="60"><br>
> <%
> 	Query = "SELECT *  FROM brand order by brand_name"
> 		set rs_brand=server.createObject("adodb.recordset")
> Line196	rs_brand.open query, strConnect 'REM "dsn=crk1.mdb"
> 		while not rs_brand.EOF
> 		%>
> 		<br>
> 		 
> 		<a
> href="<%=menu_page%>?category_code=<%=request("category_code")%>&categ
> ory_code1=<%=request("category_code1")%>&category=<%=request("category
> ")%>&brand_id=<%=rs_brand(0)%>"> <font face="Arial, Helvetica,
> sans-serif" size="2"> <%=rs_brand(1)%></font></a>	 
> 		
> 		<%	
> 		rs_brand.MoveNext
> 		wend
> 		rs_brand.close
> 		'query_b.close
> 		Set rs_brand = Nothing
> 		'Set query_b = Nothing
> 		%>
> </td>
> <%
> 
> The full code for "Main.asp" is 
> 
> <%@ LANGUAGE="VBSCRIPT" %>
> <%
> Option Explicit
> Dim StrConnect
> %>
> <!-- #include file ="datastore.asp" -->
> <!-- #include file ="errors.asp" -->
> <html>
> <head>
> <%
> Dim objConn
> 
> sub sub_category()
> Dim Query
> Dim rs1
> 	Query = "SELECT *  FROM category where parent_code='"&rs(0)&"' order
> by category_name"
> 			set rs1=server.createObject("adodb.recordset")
> 			rs1.open query, strConnect
> 'REM"dsn=crk1.mdb"
> 			while not rs1.EOF%>
> 				<tr>
> 					<td> 
> 					</td>
> 					<td>
> 					<img src="button-bluearrow.gif"
> WIDTH="5" HEIGHT="8">
> 					</td>
> 					<td>
> 					<a
> href="<%=menu_page%>?category_code=<%=rs(0)%>&category_code1=<%=rs1(0)
> %>&category=<%=rs1(0)%>">  <font face="Arial, Helvetica, sans-serif"
> size="2"><% =rs1(2)%></font> </a>
> 					<td>
> 				<tr>
> 	<%
> 		rs1.MoveNext
> 		wend
> 		rs1.close
> 		
> 		Set rs1=Nothing
> 		 
> end sub			
> %>
> </head>
> <body bgcolor="white">
> <%
> Dim menu_page
> Dim rs
> Dim query
> menu_page="main.asp"
> %>
> <table border="0" cellPadding="0" cellSpacing="0" width="100%">
> <tr>
> <td valign="top" width="200">		
> 	<p><img align="right" height="1000" src="menu_files/blackline.gif"
> width="3"><img height="20" src="menu_files/button-quicklink.gif"
> width="120"><br>
> 		<table>
> 		<%
> 		'main category
> 		Query = "SELECT *  FROM category where parent_code='0' order
> by category_name "
> 		set rs=server.createObject("adodb.recordset")
> 		rs.open query, strConnect
> 'REM,"dsn=crk1.mdb"
> 		while not rs.EOF
> 		%>
> 		<tr><td colspan=3 align=left>
> 		 
> 		<a href="<%=menu_page%>?category_code=<%=rs(0)%>">
> 			<font face="Arial, Helvetica, sans-serif" size="2">
> 				<b> <% =rs(2)%></b>
> 			</font> 
> 		</a>
> 		</td></tr>
> 
> 	<%
> 		if rs(0)=request("category_code") then
> 			call sub_category()
> 		end if
> 		%>
> 	<%
> 		rs.MoveNext
> 		wend
> 		%>
> 		</table>
> </td>
> <td valign="top" align="left">
> 
> <%
> '------------------------------------------
> 'product detail page
> Dim rs_prod_detail
> Dim query_p
> if request("sku")<>"" then 
> 		Query_p = "SELECT *  FROM product p,brand b where
> p.brand_id=b.brand_id and  sku='"&request("sku") &"'"
> 		set rs_prod_detail=server.createObject("adodb.recordset")
> 		rs_prod_detail.open query_p, strConnect
> REM"dsn=crk1.mdb"%>
> 		<p><img src="button-productdetails.gif" WIDTH="120"
> HEIGHT="20"> 
> 		<p><img src="button-brand.gif" WIDTH="100" HEIGHT="20">
> 		<br>  <font face="Arial, Helvetica, sans-serif"
> size="1"> <% =rs_prod_detail("brand_name")%></font>
> 		<% if not(trim(rs_prod_detail("brand_image_file"))="" or
> isnull(rs_prod_detail("brand_image_file")) )then %>
> 			<img
> src="Images/<%=rs_prod_detail("brand_image_file")%>">
> 		<%
> 		end if%>
> 		<p><img src="button-product.gif" WIDTH="100" HEIGHT="20">
> 		<br>  <!--<a
> href="<%=menu_page%>?category_code=<%=request("category_code")%>&categ
> ory_code1=<%=request("category_code1")%>&category=<%=request("category
> ")%>&sku=<%=rs_prod_detail(0)%>">--> <font face="Arial, Helvetica,
> sans-serif" size="2"> <% =rs_prod_detail("name")%></font>
> 		<p>
> 		 <% 
> 		if trim(rs_prod_detail(9))="" or isnull(rs_prod_detail(9))
> then %>
> 			<img src="button-nopicture.gif" WIDTH="120"
> HEIGHT="20"> 
> 			<%
> 		else%> 
> 			<img  src="Images/<%=rs_prod_detail(9)%>">
> 		<%
> 		end if%>
> 		<p><img src="button-description.gif" WIDTH="120"
> HEIGHT="20">
> 		<br>  <font face="Arial, Helvetica, sans-serif"
> size="1"> <% =rs_prod_detail("description")%></font>
> 		<p><img src="button-retailprice.gif" WIDTH="100"
> HEIGHT="20">
> 		<br>  <font face="Arial, Helvetica, sans-serif"
> size="1"> <% 
> 	if rs_prod_detail("retail_price")="0" then Response.write "N/A" else
> Response.write "$"&rs_prod_detail("retail_price") end if%></font>
> 		<%
> 		if rs_prod_detail("is_hot_product") then%>
> 			<p><img src="button-hotprice.gif" WIDTH="100"
> HEIGHT="20">
> 		<%else%>
> 			<p><img src="button-ourprice.gif" WIDTH="100"
> HEIGHT="20">
> 		<%end if%>
> 		<br>  <font face="Arial, Helvetica, sans-serif"
> size="1"> <% ="$"&rs_prod_detail("list_price")%></font>
> 		<% 
> 		if not( trim(rs_prod_detail("brochure"))="" or
> isnull("brochure")) then %>
> 			<p>
> 			<font face="Arial, Helvetica, sans-serif"
> size="3"><a href="Brochures/<%=rs_prod_detail("brochure")%>">Brouchure</a>
> </font>
> 		<%
> 		end if%>
> 		rs_prod_detail.Close
> 		query_p.close
> 		Set rs_prod_detail= Nothing
> 		Set query_p = Nothing
> 
> <%
> '-------------------------------------------------------------------------
> ------------------------		
> 	
> else
> '------------------------------------------------------------
> 'dept section
> Dim Query_n
> 
> Dim rs_name 
> Dim first
> 	if request("brand_id")<>"" then
> 		Query_n = "SELECT brand_name  FROM brand where
> brand_id="&request("brand_id")
> 		Query = "SELECT distinct *  FROM product p,brand b where
> p.brand_id=b.brand_id and  p.brand_id="&request("brand_id") & " order by
> is_hot_product"
> 	elseif request("category")<>"" then
> 		query_n= "select category_name from category where
> category_code='"&request("category") &"'"
> 		Query = "SELECT *  FROM product p,brand b where
> p.brand_id=b.brand_id and  category_code='"&request("category") &"' order
> by is_hot_product"
> 	elseif request("category_code")<>"" then
> 		first=2
> 	else
> 		'front page 
> 		first=1
> 	end if
> 	
> 	if first<>1 and first<>2 then
> 		set rs_name=server.createObject("adodb.recordset")
> 		rs_name.open query_n, strConnect
> 'REM,"dsn=crk1.mdb"
> 	end if
> 		
> 	if first=1 then%>
> 		<!--#INCLUDE FILE="front.htm" -->
> 	<%
> 	elseif first=2 then%>
> 		<!--#INCLUDE FILE="mainCat.asp" -->
> 	<%
> 	else
> 	%>	<img src="button-productlist.gif" WIDTH="120" HEIGHT="20">
> 		<font face="Arial, Helvetica, sans-serif" size="2">
> under</font><b> <font face="Arial, Helvetica, sans-serif"
> size="3"><%=rs_name(0)%> </font></b>
> 		<!--#INCLUDE FILE="list0.asp" -->
> 		<%rs_name.close
> 		query_n.close
> 		Set rs_name = Nothing
> 		Set query_n = Nothing
> 		%>
> 	<%
> 	end if
> 	
> end if%>
> 
> </td>
> <%
> '---------------------------------------------
> 'brand section
> Dim rs_brand
> 'Dim query_b
> %>
> <td valign="top" width="10%" align="left">
> <p><img align="left" height="1000" src="menu_files/blackline.gif"
> width="3">
> <img src="menu_files/title-topbrands.gif" WIDTH="150" HEIGHT="60"><br>
> <%
> 	Query = "SELECT *  FROM brand order by brand_name"
> 		set rs_brand=server.createObject("adodb.recordset")
> 		rs_brand.open query, strConnect 'REM "dsn=crk1.mdb"
> 		while not rs_brand.EOF
> 		%>
> 		<br>
> 		 
> 		<a
> href="<%=menu_page%>?category_code=<%=request("category_code")%>&categ
> ory_code1=<%=request("category_code1")%>&category=<%=request("category
> ")%>&brand_id=<%=rs_brand(0)%>"> <font face="Arial, Helvetica,
> sans-serif" size="2"> <%=rs_brand(1)%></font></a>	 
> 		
> 		<%	
> 		rs_brand.MoveNext
> 		wend
> 		rs_brand.close
> 		'query_b.close
> 		Set rs_brand = Nothing
> 		'Set query_b = Nothing
> 		%>
> </td>
> <%
> '----------------------------------------------------
> rs.close
> set rs = Nothing
> %>
> </tr>     
> </table>
> 
> </body>
> </html>
> 
> 
> 
> 
> Regards
> 
> Derek
> 
> Derek E Armitage
> Director
> 
> Words Work II Ltd
> Level 3, Tower Building
> 1172 Hauapa Street
> P O Box 604
> Rotorua
> New Zealand
> 
> Phone - 64 7 347 1733
> Fax - 64 7 347 1633
> Email - derek@w...
> Web - www.wordswork.co.nz  
> 
> 
> 

---
SoftArtisans helps developers build robust, scalable Web applications!
Excel Web reports, charts: http://www.softartisans.com/excelwriter.html
File uploads: http://www.softartisans.com/saf.html
Transactional file management: http://www.softartisans.com/saf1.html
Scalability: http://www.softartisans.com/saxsession.html
ASPstudio value pack: http://www.softartisans.com/aspstudiosuite.html
gdraper@t...
$subst('Email.Unsub')


  Return to Index