Forums
This topic is locked
Recordset troubles
Posted 16 Apr 2003 17:13:26
1
has voted
16 Apr 2003 17:13:26 Greg LeBreck posted:
I am using asp and an ACCESS database. I have created a filtered recordset to display info on a page and it works fine. Now I create another recordset on the same page to display different data and when I try it I get the error of "file already in use".The code is below, any ideas?
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/conn_DB.asp" -->
<%
Dim rs_cont__MMColParam
rs_cont__MMColParam = "index"
If (Request("MM_EmptyValue"


rs_cont__MMColParam = Request("MM_EmptyValue"

End If
%>
<%
Dim rs_cont
Dim rs_cont_numRows
Set rs_cont = Server.CreateObject("ADODB.Recordset"

rs_cont.ActiveConnection = MM_conn_DB_STRING
rs_cont.Source = "SELECT pt_content FROM page_text WHERE page_id = '" + Replace(rs_cont__MMColParam, "'", "''"

rs_cont.CursorType = 0
rs_cont.CursorLocation = 2
rs_cont.LockType = 1
rs_cont.Open()
rs_cont_numRows = 0
%>
<%
Dim conn_anno
Dim conn_anno_numRows
Set conn_anno = Server.CreateObject("ADODB.Recordset"

conn_anno.ActiveConnection = MM_conn_DB_STRING
conn_anno.Source = "SELECT announ_content FROM announc"
conn_anno.CursorType = 0
conn_anno.CursorLocation = 2
conn_anno.LockType = 1
conn_anno.Open()
conn_anno_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = -1
Repeat1__index = 0
conn_anno_numRows = conn_anno_numRows + Repeat1__numRows
%>
<html>
<head>
<title>Home Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body leftmargin="0" topmargin="0">
<!--#include file="header.asp" -->
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#9999FF">
<!--DWLayoutTable-->
<tr>
<td width="584" height="19" valign="top"> <script menumaker>document.write('<scr'+'ipt src="xaramenu.js">'+'</scr'+'ipt>');document.write('<scr'+'ipt src="xara/fcc.js">'+'</scr'+'ipt>');/*img src="xara/fcc.gif" moduleid="Default (Project)\fcc_off.xws"*/</script>
</td>
<td width="474"> </td>
</tr>
</table>
<table width="750" border="0" cellspacing="2" cellpadding="2">
<!--DWLayoutTable-->
<tr>
<td width="143" height="43"> </td>
<td width="450" valign="top"> <table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="450" height="39" valign="top"><%=(rs_cont.Fields.Item("pt_content"

</tr>
</table></td>
<td width="137"> </td>
</tr>
<tr>
<td height="25"> </td>
<td valign="top"> <table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="450" height="21" valign="top"><hr></td>
</tr>
</table></td>
<td> </td>
</tr>
<tr>
<td height="53"> </td>
<td valign="top"> <table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="450" height="20" valign="top" bgcolor="#9999FF"><strong><em>Announcements:</em></strong></td>
</tr>
<tr>
<td height="29" valign="top"> <table border="0" cellpadding="2" cellspacing="2">
<tr>
<td>announ_content</td>
</tr>
<% While ((Repeat1__numRows <> 0) AND (NOT conn_anno.EOF)) %>
<tr>
<td><%=(conn_anno.Fields.Item("announ_content"

</tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
conn_anno.MoveNext()
Wend
%>
</table>
</td>
</tr>
</table></td>
<td> </td>
</tr>
<tr>
<td height="169"> </td>
<td> </td>
<td> </td>
</tr>
</table>
<p> </p>
</body>
</html>
<%
rs_cont.Close()
Set rs_cont = Nothing
%>
<%
conn_anno.Close()
Set conn_anno = Nothing
%>
Replies
Replied 16 Apr 2003 19:56:10
16 Apr 2003 19:56:10 Greg LeBreck replied:
Little more info.
I host the site on a Windows 2000 server. Now when I put the page on my Personal web server on my desktop, all works fine. But when I put my site on the server I keep getting the file already in use error. I have tried everything from permissions to updates. Why would the server not display it.
I host the site on a Windows 2000 server. Now when I put the page on my Personal web server on my desktop, all works fine. But when I put my site on the server I keep getting the file already in use error. I have tried everything from permissions to updates. Why would the server not display it.
Replied 16 Apr 2003 20:37:41
16 Apr 2003 20:37:41 Brent Colflesh replied:
Permissions/Locking issue:
support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q174/9/43.ASP&NoWebContent=1
Regards,
Brent
support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q174/9/43.ASP&NoWebContent=1
Regards,
Brent
Replied 16 Apr 2003 20:40:38
16 Apr 2003 20:40:38 Greg LeBreck replied:
I have tried that and no go. Why would that work different on the server as opposed to my pws?
Replied 16 Apr 2003 21:31:54
16 Apr 2003 21:31:54 Brent Colflesh replied:
Connecting to PWS on your own machine is a whole different locking/permissions situation that doing so to a remote NT server -
You need to read the MS Knowledge Base article - or maybe some related ones - again. You've missed something...
Regards,
Brent
You need to read the MS Knowledge Base article - or maybe some related ones - again. You've missed something...
Regards,
Brent
Replied 16 Apr 2003 22:26:41
16 Apr 2003 22:26:41 Greg LeBreck replied:
Alright I get what your saying and I have read the article, so I guess I'm just alittle slow. If I give total control to the database for ISuser isn't that going to be a security risk? For example the database has "read & exuecute", "read", and "write" permission on it already. If I give it full control that would open it up.
Replied 17 Apr 2003 16:24:33
17 Apr 2003 16:24:33 Brent Colflesh replied:
IUSER_ needs access to the .mdb file - It sounds like you have access to the server, so get Properties on the .mdb file in the \wwwroot, then the Security tab, Permissions, then add IUSER_.
Regards,
Brent
Regards,
Brent