Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Database with RDS


Message #1 by "Gustavo de Castro Amaral" <gcamaral@c...> on Wed, 7 Jun 2000 20:14:27
  I'm trying to run a simple example given in the John Papa's book 

"Professional ADO RDS 2.5 programming with ASP". In this example i use the 

RDS.Datacontrol object to acess my database. It's a simple page that has 

two buttons to move the resulting records of my query forward and 

backward.

  When I load the page there is no error. But when I click on the buttons, 

the following error is shown:(I don't know if my translation is correct)

  "Operation request by the application not allowed if the object closed"

  The source code of the file:



  <html>

<object id=objDC classid="clsid:BD96C556-65A3-11D0-983A-00C04FC29E33"

  height="1" width="1"> 

<param name="server" 

value="http://<%=request.servervariables("server_name")%>">

</object>

<head>

	<title>Primeiro teste de RDS</title>

</head>

<script language="VBScript"> 

sub window_onload()

	 objDC.Connect = "DSN=gustavo;UID=;PWD=;"

	 objDC.SQL = "select pnome, snome,cidade,estado from contatos order by 

pnome, snome"

	 objDC.Refresh

end sub 



sub Proximo()

	objDC.Recordset.MoveNext

	if objDC.recordset.eof then

		msgbox ("Este é o último registro")

		objDC.recordset.movelast

	end if

end sub



sub Anterior()

	objDC.Recordset.MovePrevious

	if objDC.recordset.bof then

		msgbox ("Este é o último registro")

		objDC.recordset.movefirst

	end if

end sub

</script>



<body bgcolor="Silver">

<center>

<h2>CONTATOS</h2>

<form name="index" method="post">

<table border="1" dataSRC=#objDC>

<thead align="left">

<tr><th>Nome</th><th>Cidade</th><th>Estado</th><th>Telefone</th>

</tr>

<tr>

<th><input type="Text"  name="txtnome" dataFLD="nome" size="20"></th>

<th><input type="Text" dataFLD="cidade" size="12"></th>

<th><input type="Text" dataFLD="Estado" size="12"></th>

<th><input type="Text" dataFLD="fone" size="12"></th>

</tr>

</table>

<br>

<font size="2">Utilize os botőes para movimentar os registros </font>

<br>

<input type="button" value="  <  " onclick="Proximo">

<input type="button" value="  >  " onclick="Anterior">

</form>

</body>

</html>



        




  Return to Index