Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Re: asp_databases digest: March 29, 2002


Message #1 by Niraj Sharma <nsharma@y...> on Sat, 30 Mar 2002 08:10:28 -0800 (PST)
I am trying to do something similar:

I have an .asp page which retrieves a long list of
items on my website. I want to creat a static .htm
version of the dynamic data for this page.

How can I do this?

--- ASP Databases digest <asp_databases@p...>
wrote:
> -----------------------------------------------
> When replying to the digest, please quote only
> relevant material, and edit the subject line to
> reflect the message you are replying to.
> -----------------------------------------------
> 
> The URL for this list is:
> http://p2p.wrox.com/list.asp?list=asp_databases
> 
> Get the Readers Advantage price for 
> Professional ASP Data Access from Barnes & Noble.
> ---
> 
>
http://service.bfast.com/bfast/click?bfmid=2181&sourceid=38934667&bfpid=1861003927&bfmtype=book
> 
> ASP_DATABASES Digest for Friday, March 29, 2002.
> 
> 1. Updating records
> 2. problem in inserting dato in MS Acess
> 3. RE: problem in inserting dato in MS Acess
> 4. RE: Updating records
> 5. RE: Updating records
> 6. Re: Creating an ODBC link to access db on the web
> 7. RE: problem with insert data into database
> 
>
----------------------------------------------------------------------
> 
> Subject: Updating records
> From: fred.sonderman@o...
> Date: Fri, 29 Mar 2002 09:13:38
> X-Message-Number: 1
> 
> 
> Hi all,
> 
> I am having problems getting the following script to
> save for me.  I hope 
> somebody will notice something out of place.
> 
> Thanks in advance,
> Bill
> 
> <%@ LANGUAGE="VBSCRIPT" %>
> <%
> 'Set how many records per page we want
>  InitialNumPerPage = 1
> 
> 'Retrieve what page we're currently on
> if request.form ("NumPerPageText")= "" AND
> request.querystring
> ("NumPerPage") = "" Then
> 	NumPerPage = InitialNumPerPage
> 	else
> 		if request.form ("NumPerPageText") = "" Then
> 			NumPerPage = request.querystring("NumPerPage")
> 		Else
> 			NumPerPage = request.form ("NumPerPageText")
> 		End If
> 	End If
> 	
> Dim CurPage
> if request.querystring("CurPage") = "" Then
> 	CurPage = 1
> else
> 	CurPage = request.querystring("CurPage")
> end if
> 
> '--Declare variable
> 
> Dim Dataconnection, cmdDC, RecordSet
> Dim RecordToEdit, Updated
> 
> Set dataconnection 
> Server.CreateObject("ADODB.Connection")
> dataconnection.Open "Provider=SQLOLEDB; DATA
> Source=default; initial 
> catalog=pubs; user ID=sa; Password=;"
> 
> set cmdDC = Server.CreateObject("ADODB.Command")
> cmdDC.ActiveConnection = DataConnection
> 
> 'Open our recordset
> Dim SQL
> SQL = "SELECT * FROM stores"
> 
> cmdDC.CommandText = SQL
> 'Explicitly Create a recordset object
> Dim rs
> Set RecordSet 
> Server.CreateObject("ADODB.Recordset")
>  
> '*************************Paging system
> *******************************
> 'Set cursor location property
> RecordSet.cursortype =3 
> RecordSet.cursorlocation =3
> set RecordSet.ActiveConnection = Dataconnection
> 'Set the cache size = to the # of records/page
> RecordSet.cacheSize = NumPerPage
> '*************************End Paging system
> *******************************
> 
> RecordSet.Open cmdDC, , 0, 3
> 
> RecordSet.MoveFirst
> RecordSet.PageSize = NumPerPage
> 
> 'Get the max number of pages
> Dim TotalPages
> TotalPages = RecordSet.PageCount
> 
> 'Set the absolute page
> RecordSet.AbsolutePage = CurPage
> 
> 'Counting variable for our recordset
> Dim count,strSearch
> 
> 
> '******** End Paging System
> 
> '************* Updating Record ***************
> if Request.form("btnUpdate") = "SAVE" Then
> 
> 'gather form field values
> stor_name = request.form("stor_name")
> city = request.form("city")
> 	 
>      
> 
>       'define the update query
>      strUpdate = "UPDATE stores set
> stor_name='"&stor_name&"', 
> city='"&city&"' WHERE stor_id="&id&""
> 
>       'execute the update
>       cmdDC.Execute(strUpdate)
> 
> 	updated = "True"
> End if
> '**********************************************
>  
> %>
> 
> <HTML>
> <head>
> <title>Stores information</title>
> <script language="javascript">
> 	<!--
> 	//
> 	function confirmsave()
> 	{
> 	var agree=confirm("Are you sure you want to make
> changes to this 
> record?");
> 	if (agree)
> 		return true;
> 	else
> 		return false;
> 	}
> 	// -->
> </script>
> </head>
> <BODY>
> <form name="storeForm" action="default.asp"
> method="post">
> <table>
> 	<tr>
> 		<td>
> 			<%
> 			''First/Last butons
> 			Response.write("<input type=button  value=FIRST 
>
onclick=""document.location.href='default.asp?Curpage=1&NumPerPage=")
> 			response.write(  NumPerPage & "';"">")
> 			%>
> 		</td>
> 		<td>
> 			<%
> 			''Prev buton
> 			If CurPage > 1 then
> 			Response.write("<input type=button  value=PREV 
>
onclick=""document.location.href='default.asp?Curpage=")
> 			response.write(  curpage -1 & "&NumPerPage=" & 
> NumPerPage & "';"">")
> 			End if
> 			%>
> 		</td>
> 		<td>
> 			<%
> 			''NEXT buton
> 			If CInt(curpage) <> Cint(totalpages) then
> 			Response.write("<input type=button  value=NEXT 
>
onclick=""document.location.href='default.asp?Curpage=")
> 			response.write(  curpage + 1 & "&NumPerPage=" & 
> NumPerPage & "';"">")
> 			End if
> 			%>
> 
> 		</td>
> 		<td>
> 			<%
> 			''LAST buton
> 
=== message truncated ===


__________________________________________________
Do You Yahoo!?
Yahoo! Greetings - send holiday greetings for Easter, Passover
http://greetings.yahoo.com/

  Return to Index