Code Bank
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingCode Bank

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old October 7th, 2004, 11:30 PM
Misty Misty is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 432 Misty User rank is Private First Class (20 - 50 Reputation Level)Misty User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 3 h 42 m 55 sec
Reputation Power: 5
Problem with Comparing Integers

I am trying to compare two integers. Please look at the below code. If the integers are not equal, I want the AreaID for a certain city to be updated. Can someone please help me with this?



Error Message:

Microsoft OLE DB Provider for SQL Servererror '80040e21'Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.

Here's the code that I tried to use:



Microsoft OLE DB Provider for SQL Servererror '80040e21'Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.

Here's the code that I tried to use:



<FONT size=2><FONT face="Courier New"> 'Build the sql query used to fill the select element

Last edited by Misty : October 7th, 2004 at 11:33 PM. Reason: I didn't get everything.

Reply With Quote
  #2  
Old October 7th, 2004, 11:34 PM
Misty Misty is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 432 Misty User rank is Private First Class (20 - 50 Reputation Level)Misty User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 3 h 42 m 55 sec
Reputation Power: 5
It Didn't Post All of My Code

Here's the code that I tried to use:



'Build the sql query used to fill the select element


sql = "select IsNull(AreaID, 0) as AreaID from City"


sql = sql & " where City= '" & hidCity & "'"


sql = sql & " and State= '" & hidState & "'"


'Create a recordset


set rsCity = Server.CreateObject("ADODB.Recordset")


rsCity.Open sql, connectionString, adOpenDynamic, adLockOptimistic



If rsCity.EOF then

'Area doesn't exist in state
Response.write(hidCity & " in " & hidState & " does not exist in database")


Else

'Area does exist in DB


'Check to see if the database already has this area



If CLng(Area) <> CLng(rsCity("AreaID")) then




'Move to the next recordset


rsCity.MoveFirst
rsCity("AreaID") = Area
rsCity.update




End If
End If

Reply With Quote
  #3  
Old October 12th, 2004, 11:26 PM
mehraj_unnisa mehraj_unnisa is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 1 mehraj_unnisa User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Error:-Overflow: 'cint'

Hi ,
I get this error
Microsoft VBScript runtime (0x800A0006)
Overflow: 'cint'

For the following code.
<%@ Language=VBScript %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>
<TABLE BORDER = "2" WIDTH = "100" bgcolor=SpringGreen>
<TR><CENTER>DATA</CENTER></TR>
<TR>
<TD>X39</TD>
</TR>
<tr>
<%
SET conn = server.CreateObject("ADODB.connection")
conn.connectionstring = "User ID=dwhrep;Password=dwhrep;Data Source=dwhrep_sdw1"
CONN.OPEN
%>
<%
query1 = "select n4_unlimited_amt FROM sgw_x3_cr_demand_capacity_sum "
query1 = query1 & "where organization_code ='HIM'"
set rs = conn.Execute(query1)
Response.Write "<tr>"
while not rs.EOF
if cint(rs("n4_unlimited_amt"))<1000 then
Response.Write "<TD bgcolor=Red>" & RS.fields("n4_unlimited_amt") & "%</TD>"
else
Response.Write "<TD>" & RS.fields("n4_unlimited_amt") & "%</TD>"
end if
RS.MOVENEXT
wend
Response.Write "</tr>"
%>

<P>&nbsp;</P>
</BODY>
</HTML>


The records in the table are 50, it works fine for just 10 records.

Please help me in this

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingCode Bank > Problem with Comparing Integers


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT