Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 21st, 2005, 11:46 AM
Friend of Wrox
Points: 1,107, Level: 13
Points: 1,107, Level: 13 Points: 1,107, Level: 13 Points: 1,107, Level: 13
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2004
Location: , , .
Posts: 240
Thanks: 0
Thanked 1 Time in 1 Post
Default why not UPDATE all instead of 10 at a time?

THinking that the reasone why it's not UPDATING all was because the the page holds 10 records at a time right? I tried blocking all the codes which have to do with pageing but it's not working. Can you show me what I missed (if that's the reason why it cannot UPDATE all at once)?
Code:
<% Option Explicit 

' ADO constants used in this page
Const adOpenForwardOnly = 0
Const adLockReadOnly = 1
Const adCmdTableDirect = &H0200
Const adUseClient = 3
%>
<html>
<head>
  <style>
  body { font-family : Verdana; font-size : 8pt; }
  a { font-family : Verdana; font-size : 8pt; text-decoration : none; }
  </style>
</head>

<body>
<%
  Dim connStr
    connStr = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("hebrewbible.mdb")

        Dim ans
        Dim i
        Dim rs
        Dim SQL
        Dim TheString, ArrayTemp, NumberOfWords, Word

function getKeyValue_h(chr)
  //A select statement is more efficient for this
  select case chr
   case "a"
    getKeyValue_h = 1 
   case "b"  
    getKeyValue_h = 2 
   case "g"
    getKeyValue_h = 3 
   case "d"
    getKeyValue_h = 4 
   case "h"
    getKeyValue_h = 5 
   case "w"
    getKeyValue_h = 6 
   case "z"
    getKeyValue_h = 7 
   case "x"
    getKeyValue_h = 8 
   case "j"
    getKeyValue_h = 9 
   case "y"
    getKeyValue_h = 10 
   case "k","$"
    getKeyValue_h = 20 
   case "l"
    getKeyValue_h = 30 
   case "m","~"
    getKeyValue_h = 40 
   case "n","!"
    getKeyValue_h = 50 
   case "s"
    getKeyValue_h = 60 
   case "["
    getKeyValue_h = 70 
   case "p","@"
    getKeyValue_h = 80 
   case "c","#"
    getKeyValue_h = 90 
   case "q"
    getKeyValue_h = 100 
   case "r"
    getKeyValue_h = 200
   case "f","v"
    getKeyValue_h = 300 
   case "t"
    getKeyValue_h = 400
   case else
    getKeyValue_h = 0
  end select
end function 

function computeValue(str)
  ans = 0
  for i = 0 to len(str)
    ans = ans + getKeyValue_h(mid(str,i+1,1))
  next
  computeValue = ans 
end function

SQL = "SELECT * from hebrewbibletable"
SQL = SQL & " ORDER by id ASC "  

    Set rs = Server.CreateObject("ADODB.Recordset")

'    rs.PageSize = 10
'    rs.CacheSize = 5
'    rs.CursorLocation = adUseClient



    rs.Open SQL, connStr, adOpenForwardOnly, adLockReadOnly, adCmdTableDirect


'    If Len(Request("pagenum")) = 0  Then
'a        rs.AbsolutePage = 1
'      Else
'        If CInt(Request("pagenum")) <= rs.PageCount Then
'            rs.AbsolutePage = Request("pagenum")
'          Else
'            rs.AbsolutePage = 1
'        End If
'    End If

'    Dim abspage, pagecnt
'      abspage = rs.AbsolutePage
'      pagecnt = rs.PageCount

    If Not rs.EOF Then
'      Response.Write "PageCount : " & rs.PageCount & "<br>" & vbcrlf
'      Response.Write "Absolute Page : " & rs.AbsolutePage & "<br>" & vbcrlf

        Response.Write "Total number of records : " & rs.RecordCount & "<br><br>" & vbcrlf

        Dim fldF, intRec%>
<form method="post" action="pageing2update.asp">
<%'<form method="post" action="pageing4.asp">
'<form method="post" action="pageing2update3.asp">

        Response.Write "<table border=1 align=center cellpadding=3 cellspacing=0><thead><tr>"
        For Each fldF in rs.Fields
          Response.Write "<td>" & fldF.Name & "</td>"
        Next
        Response.Write "<td><input type=""submit"" value=""Add New""></td></tr></thead><tbody>"
        For intRec=1 To rs.PageSize
          If Not rs.EOF Then
            Response.Write "<tr>"
            For Each fldF in rs.Fields
              Response.Write "<td>" & fldF.Value & "</td>"
            Next%>
<td><%=rs("id")%>
<input type="hidden" name="id_<%=intRec%>"
 value="<%=rs.Fields("id").Value%>">
<textarea name="gemetria_<%=intRec%>"  
id="gemetria_<%=intRec%>">
<%'Dim TheString, ArrayTemp, NumberOfWords, Word
  TheString = rs("text_data")
  ArrayTemp = split(TheString, " ")
  NumberOfWords = UBound(ArrayTemp) + 1
'dont need  Response.Write "<P>The String is: " & TheString
'   Response.Write "<P><i>Number of words:</i> " & NumberOfWords
'        Response.Write "<BR>Total=" & computeValue(TheString)  
'dont need  Response.Write "<P>Here are the words which compose that string: "
  For Each Word In ArrayTemp
'  Response.Write "<BR>" & word & "="
  response.write computeValue(word)
       response.write "&nbsp;+&nbsp;"
  next

%>
</textarea></td>
<%
            Response.Write "<tr>"
            rs.MoveNext
          End If
        Next
        Response.Write "</tbody></table><p>"

        ' Now showing first, next, back, last buttons.
'        Response.Write "<div align=""center"">" & vbcrlf
'        Response.Write "<a href=""" & Request.ServerVariables("SCRIPT_NAME") & "?pagenum=1"">First Page</a>"
'        Response.Write "&nbsp;|&nbsp;"

'        If abspage = 1 Then
'        Response.Write "<span style=""color:silver;"">Previous Page</span>"
'        Else
'        Response.Write "<a href=""" & Request.ServerVariables("SCRIPT_NAME") & "?pagenum=" & abspage - 1 & """>Previous Page</a>"
'        End If
'                Response.Write "&nbsp;|&nbsp;"

'        If abspage < pagecnt Then
'        Response.Write "<a href=""" & Request.ServerVariables("SCRIPT_NAME") & "?pagenum=" & abspage + 1 & """>Next Page</a>"
'        Else
'        Response.Write "<span style=""color:silver;"">Next Page</span>"
'        End If
'        Response.Write "&nbsp;|&nbsp;"
'        Response.Write "<a href=""" & Request.ServerVariables("SCRIPT_NAME") & "?pagenum=" & pagecnt & """>Last Page</a>"
'        Response.Write "</div>" & vbcrlf%>
</form>
<%        
    Else
      Response.Write "No records found!"
    End If

    rs.Close
    Set rs = Nothing
%>
</body>
</html>
Martial Law 9/11 Rise of the Police State is now available! Visit our Martial Law movie section for complete info (click here), or order now by clicking the button below or by calling 888-253-3139
http://www.infowars.com/martial_law_911.htm




Similar Threads
Thread Thread Starter Forum Replies Last Post
Forum Down time and new forums Dec 8-10 jminatel General Announcements 0 December 5th, 2008 10:10 AM
change database location on CR 10 at run time blu3_x30n Pro VB 6 0 March 30th, 2006 01:25 PM
Update VS.NET to use Crystal Report 10 DLL ank2go VS.NET 2002/2003 2 January 26th, 2005 01:52 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.