Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


why not UPDATE all instead of 10 at a time?

 
Logged in as: Guest
arrSession:exec spGetSession 2,3,2768
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> ASP >> why not UPDATE all instead of 10 at a time?
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 why not UPDATE all instead of 10 at a time? - 4/21/2005 4:57:15 AM   
  gilgalbiblewheel

 

Posts: 14
Score: 0
Joined: 4/6/2005
From:
Status: offline
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><font size=""5"" face=""BSTHebrew"">" & word & "</font>="
response.write computeValue(word)
response.write " + "
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 " | "

' 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 " | "

' 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 " | "
' 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>[/CODE]
 
 
Post #: 1
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> ASP >> why not UPDATE all instead of 10 at a time? Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts