Listas Dinamicas en ASP+ACCESS

08/01/2004 - 09:51 por Sergio Forever | Informe spam
Buenas!!

Me gustaría realizar listas dinamicas a partir de unas tablas maestro
creadas en access y el problema es que me da un error y como soy novato no
se porque!!
-Este es el error
Tipo de error:
Microsoft JET Database Engine (0x80004005)
No se pudo usar ''; el archivo ya está en uso.
/proyectos/presupuestos/Presupuestos.asp, línea 8

-Esa es la línea 8:
dbRecord1.ActiveConnection = MM_db_presupuestos_STRING

Gracias. Salu2!!

Preguntas similare

Leer las respuestas

#1 Juan Carlos Martínez Fernández
08/01/2004 - 10:04 | Informe spam
Lo que ocurre es que tienes bloqueado el acceso a la BD. Seguramente la
tengas abierta en modo exclusivo.

Prueba a cerrarla, y prueba de nuevo. Si no funciona, compactala y reparala
para volver a probarla de nuevo.

Espero haberte sido util. Recibe un cordial saludo.

Juan Carlos Martínez Fernández


"Sergio Forever" escribió en el mensaje
news:
Buenas!!

Me gustaría realizar listas dinamicas a partir de unas tablas maestro
creadas en access y el problema es que me da un error y como soy novato no
se porque!!
-Este es el error
Tipo de error:
Microsoft JET Database Engine (0x80004005)
No se pudo usar ''; el archivo ya está en uso.
/proyectos/presupuestos/Presupuestos.asp, línea 8

-Esa es la línea 8:
dbRecord1.ActiveConnection = MM_db_presupuestos_STRING

Gracias. Salu2!!


Respuesta Responder a este mensaje
#2 urko
08/01/2004 - 10:21 | Informe spam
Si la tienes la BD abierta con el access tambien te puede generar el error.
saludos
urko

"Sergio Forever" escribió en el mensaje
news:
Buenas!!

Me gustaría realizar listas dinamicas a partir de unas tablas maestro
creadas en access y el problema es que me da un error y como soy novato no
se porque!!
-Este es el error
Tipo de error:
Microsoft JET Database Engine (0x80004005)
No se pudo usar ''; el archivo ya está en uso.
/proyectos/presupuestos/Presupuestos.asp, línea 8

-Esa es la línea 8:
dbRecord1.ActiveConnection = MM_db_presupuestos_STRING

Gracias. Salu2!!


Respuesta Responder a este mensaje
#3 Sergio Forever
08/01/2004 - 10:43 | Informe spam
Buenas de nuevo!!

Me sigue dando el mismo error!!
Esta vez te dejo el codigo y la configuracion de la conexion!!

Conexion:
<%
' FileName="Connection_ado_conn_string.htm"
' Type="ADO"
' DesigntimeType="ADO"
' HTTP="false"
' Catalog=""
' Schema=""
Dim MM_db_presupuestos_STRING
MM_db_presupuestos_STRING = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\Presupuestos\Presupuestos.mdb;Persist Security Info=False;"
%>
Y el codigo fuente:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/db_presupuestos.asp" -->
<%
Dim dbRecord1
Dim dbRecord1_numRows

Set dbRecord1 = Server.CreateObject("ADODB.Recordset")
dbRecord1.ActiveConnection = MM_db_presupuestos_STRING
dbRecord1.Source = "SELECT * FROM AreaGI"
dbRecord1.CursorType = 3
dbRecord1.CursorLocation = 3
dbRecord1.LockType = 1
dbRecord1.Open()
dbRecord1_numRows = 0

%>
<%
Dim dbRecordConcepto
Dim dbRecordConcepto_numRows

Set dbRecordConcepto = Server.CreateObject("ADODB.Recordset")
dbRecordConcepto.ActiveConnection = MM_db_presupuestos_STRING
dbRecordConcepto.Source = "SELECT * FROM ConceptoGI"
dbRecordConcepto.CursorType = 3
dbRecordConcepto.CursorLocation = 3
dbRecordConcepto.LockType = 1
dbRecordConcepto.Open()

dbRecordConcepto_numRows = 0
%>
<%
Dim dbRecordDetalle
Dim dbRecordDetalle_numRows

Set dbRecordDetalle = Server.CreateObject("ADODB.Recordset")
dbRecordDetalle.ActiveConnection = MM_db_presupuestos_STRING
dbRecordDetalle.Source = "Select * from DetalleGI"
dbRecordDetalle.CursorType = 0
dbRecordDetalle.CursorLocation = 2
dbRecordDetalle.LockType = 1
dbRecordDetalle.Open()

dbRecordDetalle_numRows = 0
%>
<%
Dim dbProyecto
Dim dbProyecto_numRows

Set dbProyecto = Server.CreateObject("ADODB.Recordset")
dbProyecto.ActiveConnection = MM_db_presupuestos_STRING
dbProyecto.Source = "select * from proyectos"
dbProyecto.CursorType = 0
dbProyecto.CursorLocation = 2
dbProyecto.LockType = 1
dbProyecto.Open()

dbProyecto_numRows = 0
%>
<%
Dim dbRecordCentroCoste
Dim dbRecordCentroCoste_numRows

Set dbRecordCentroCoste = Server.CreateObject("ADODB.Recordset")
dbRecordCentroCoste.ActiveConnection = MM_db_presupuestos_STRING
dbRecordCentroCoste.Source = "Select * from [Centros de Coste]"
dbRecordCentroCoste.CursorType = 0
dbRecordCentroCoste.CursorLocation = 2
dbRecordCentroCoste.LockType = 1
dbRecordCentroCoste.Open()

dbRecordCentroCoste_numRows = 0
%>
<%
' *** Recordset Stats, Move To Record, and Go To Record: declare stats
variables

Dim dbRecord1_total
Dim dbRecord1_first
Dim dbRecord1_last

' set the record count
dbRecord1_total = dbRecord1.RecordCount

' set the number of rows displayed on this page
If (dbRecord1_numRows < 0) Then
dbRecord1_numRows = dbRecord1_total
Elseif (dbRecord1_numRows = 0) Then
dbRecord1_numRows = 1
End If

' set the first and last displayed record
dbRecord1_first = 1
dbRecord1_last = dbRecord1_first + dbRecord1_numRows - 1

' if we have the correct record count, check the other stats
If (dbRecord1_total <> -1) Then
If (dbRecord1_first > dbRecord1_total) Then
dbRecord1_first = dbRecord1_total
End If
If (dbRecord1_last > dbRecord1_total) Then
dbRecord1_last = dbRecord1_total
End If
If (dbRecord1_numRows > dbRecord1_total) Then
dbRecord1_numRows = dbRecord1_total
End If
End If
%>
<%
' *** Recordset Stats: if we don't know the record count, manually count
them

If (dbRecord1_total = -1) Then

' count the total records by iterating through the recordset
dbRecord1_total=0
While (Not dbRecord1.EOF)
dbRecord1_total = dbRecord1_total + 1
dbRecord1.MoveNext
Wend

' reset the cursor to the beginning
If (dbRecord1.CursorType > 0) Then
dbRecord1.MoveFirst
Else
dbRecord1.Requery
End If

' set the number of rows displayed on this page
If (dbRecord1_numRows < 0 Or dbRecord1_numRows > dbRecord1_total) Then
dbRecord1_numRows = dbRecord1_total
End If

' set the first and last displayed record
dbRecord1_first = 1
dbRecord1_last = dbRecord1_first + dbRecord1_numRows - 1

If (dbRecord1_first > dbRecord1_total) Then
dbRecord1_first = dbRecord1_total
End If
If (dbRecord1_last > dbRecord1_total) Then
dbRecord1_last = dbRecord1_total
End If

End If
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Presupuestos</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="javascript" src="presupuestos.js"></script>
<link href="presupuestos.css" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if
((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight;
onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH)
location.reload();
}
MM_reloadPage(true);
//-->
</script>
</head>

<body class="Presupuestos">
<center><h1>&nbsp;</h1>
<form name="presupuestos" method="post" action="http://" onSubmit="return
vDatos(this)">
<table width="367" border="0">
<tr bgcolor="#CCCCCC">
<td colspan="3"><div align="center">
<h1>Presupuestos</h1>
</div></td>
</tr>
<tr>
<td width="131">A&ntilde;o:</td>
<td width="120"><input name="anio" type="text" id="anio" size="8"
maxlength="4"></td>
<td width="95">&nbsp;</td>
</tr>
<tr>
<td><div align="left">CodigoAreaGI:</div></td>
<td><select name="AreaGI" id="AreaGI" >
<% dbrecord1.movefirst
while not dbrecord1.eof %>
<option value="<%=dbRecord1("CodigoAreaGI")
%>"><%=dbRecord1("DescripcionAreaGI") %></option>
<% dbrecord1.movenext%>
<% wend %>
</select> </td>
<td>&nbsp;</td>
</tr>
<tr>
<td><div align="left">CodigoConceptoGI:</div></td>
<td><select name="ConceptoGI" id="ConceptoGI" >
<% dbrecordConcepto.movefirst
while not dbrecordConcepto.eof %>
<option value="<%=dbRecordConcepto("CodigoConceptoGI")
%>"><%=dbRecordConcepto("DescripcionConceptoGI") %></option>
<% dbrecordConcepto.movenext%>
<% wend %>
</select></td>
<td>&nbsp;</td>
</tr>
<tr>
<td><div align="left">CodigoDetalleGI:</div></td>
<td><select name="DetalleGI" id="DetalleGI">
<% dbrecordConcepto.movefirst
while not dbrecordConcepto.eof %>
<option value="<%=dbrecordConcepto("CodigoConceptoGI")
%>"><%=dbrecordConcepto("DescripcionConceptoGI") %></option>
<% dbrecordConcepto.movenext%>
<% wend %>
</select></td>
<td>&nbsp;</td>
</tr>
<tr>
<td><div align="left">CodigoProyecto:</div></td>
<td><select name="Proyecto" id="Proyecto">
<% dbProyecto.movefirst
while not dbProyecto.eof %>
<option value="<%=dbProyecto("CodigoProyecto")
%>"><%=dbProyecto("DescripcionProyecto") %></option>
<% dbProyecto.movenext%>
<% wend %>
</select></td>
<td>&nbsp;</td>
</tr>
<tr>
<td><div align="left">CodigoCentroCoste:</div></td>
<td><select name="CentroCoste" id="CentroCoste">
<select name="Proyecto" id="Proyecto">
<% dbRecordCentroCoste.movefirst
while not dbRecordCentroCoste.eof %>
<option value="<%=dbRecordCentroCoste("CodigoCentroCoste")
%>"><%=dbRecordCentroCoste("DescripcionCentroCoste") %></option>
<% dbRecordCentroCoste.movenext%>
<% wend %>
</select>
</select></td>
<td>&nbsp;</td>
</tr>
<tr>
<td height="18"><div align="left"></div></td>
<td align="left" valign="middle">&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td height="18">GI:</td>
<td align="left" valign="middle"><input type="radio" name="GI"
value="gasto">
Gasto</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><div align="left"></div></td>
<td align="left" valign="middle"><input type="radio" name="GI"
value="ingreso">
Ingreso</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><div align="left">Unidades:</div></td>
<td><input name="unidades" type="text" id="unidades" size="20"></td>
<td>&nbsp;</td>
</tr>
<tr>
<td><div align="left">Precio:</div></td>
<td><input name="textfield" type="text" size="20"></td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr bordercolor="#CCCCCC" bgcolor="#CCCCCC">
<td colspan="3"><div align="right">Total: 0 &#8364;</div> </td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td height="40" align="center" valign="middle"><input name="Añadir"
type="submit" id="Añadir" value="Añadir"></td>
<td align="center" valign="middle"><input name="Eliminar"
type="submit" id="Eliminar" value="Eliminar"></td>
<td align="center" valign="middle"><input name="Consultar"
type="submit" id="Consultar" value="Consultar"></td>
</tr>
</table>

<p>&nbsp;</p>
</form>
</center>
</body>
</html>
<%
dbRecord1.Close()
Set dbRecord1 = Nothing
%>
<%
dbRecordConcepto.Close()
Set dbRecordConcepto = Nothing
%>
<%
dbRecordDetalle.Close()
Set dbRecordDetalle = Nothing
%>
<%
dbProyecto.Close()
Set dbProyecto = Nothing
%>
<%
dbRecordCentroCoste.Close()
Set dbRecordCentroCoste = Nothing
%>
Espero que me podais ayudar.

Gracias de nuevo y perdon por mi torpeza!! ;P
Respuesta Responder a este mensaje
#4 Sergio Forever
08/01/2004 - 11:20 | Informe spam
Buenas!!
No he cerrado Access y me da el error con la base de datos cerrada y por eso
no se porque casca!!

Gracias.Salu2.
Respuesta Responder a este mensaje
#5 Sashka
08/01/2004 - 19:15 | Informe spam
http://support.microsoft.com/defaul...US;Q174943

Es un asunto de permisos... el usuario de internet IUSR_<NombreMaquina> debe
tener permisos de lectura en la carpeta que contiene la BD.

Sashka

"Sergio Forever" escribió en el mensaje
news:%
Buenas!!
No he cerrado Access y me da el error con la base de datos cerrada y por


eso
no se porque casca!!

Gracias.Salu2.


email Siga el debate Respuesta Responder a este mensaje
Ads by Google
Help Hacer una preguntaRespuesta Tengo una respuesta
Search Busqueda sugerida