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

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 May 13th, 2008, 07:30 AM
djfubar djfubar is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 416 djfubar User rank is Corporal (100 - 500 Reputation Level)djfubar User rank is Corporal (100 - 500 Reputation Level)djfubar User rank is Corporal (100 - 500 Reputation Level)djfubar User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 5 Days 2 h 5 m 49 sec
Reputation Power: 6
Recordset error "Exception occurred."

Hi All,

IM trying to display some information if the recordet contains 1 or more records but am recieving the following error

Code:
Exception occurred. 


Here is my code
Code:
RequestID=Request.Form("REF")
			
SQLQuery ="SELECT contact FROM caselist WHERE CaseID="
& RequestID & ""
SET rscontact = objConnection.Execute(SQLQuery)	 
			
						   
SQLQuery ="SELECT username, MNGR_ID, COUNT(MNGR_ID) AS TEST FROM employee WHERE username LIKE '%" & rscontact("Contact") & "%' GROUP BY username, mngr_id"
SET rsusername = objConn.Execute(SQLQuery)
			
			
IF rsusername("TEST") <> 0 THEN 

SQLQuery ="SELECT * FROM employee WHERE user_id = '" & rsusername("mngr_id") & "' "
SET rsmanagerid = objConn.Execute(SQLQuery)

SQLQuery ="SELECT * FROM employee WHERE user_id = '" & rsmanagerid("mngr_id") & "' "
SET rsmanagerid2 = objConn.Execute(SQLQuery) %>
			
<TD BGCOLOR="#f7fbae"> 
<FONT FACE="VERDANA" SIZE=2><B>DOAG:&nbsp;&nbsp;</B>
<SELECT NAME="PURCHASE" VALUE="" style= visibility:hidden>	
<%IF rsusername("ProcessOrder") = 1 THEN%> 	
<OPTION VALUE = "<%=rsusername("username")%>"><%=rsusername("username")%></OPTION>
<%ELSE IF rsmanagerid("ProcessOrder") = 1 THEN%> 
<OPTION VALUE = "<%=rsmanagerid("username")%>"><%=rsmanagerid("username")%></OPTION>
<%ELSE IF rsmanagerid2("ProcessOrder") = 1 THEN%> 
<OPTION VALUE = "<%=rsmanagerid2("username")%>"><%=rsmanagerid2("username")%></OPTION>
<%END IF%> 
<%END IF%>
<%END IF%>


the rsusername recordset is where the issue is. There is currently no reocrds in this reocordset and im trying to complete and if statment based of it (where i think the issue is)

Any help would be great

thanks

Last edited by djfubar : May 13th, 2008 at 07:34 AM.

Reply With Quote
  #2  
Old May 13th, 2008, 08:13 AM
mmltonge mmltonge is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 203 mmltonge User rank is Second Lieutenant (5000 - 10000 Reputation Level)mmltonge User rank is Second Lieutenant (5000 - 10000 Reputation Level)mmltonge User rank is Second Lieutenant (5000 - 10000 Reputation Level)mmltonge User rank is Second Lieutenant (5000 - 10000 Reputation Level)mmltonge User rank is Second Lieutenant (5000 - 10000 Reputation Level)mmltonge User rank is Second Lieutenant (5000 - 10000 Reputation Level)mmltonge User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Day 17 h 36 m 49 sec
Reputation Power: 56
Change it to

Code:
SQLQuery ="SELECT username, MNGR_ID FROM employee WHERE username LIKE '%" & rscontact("Contact") & "%' GROUP BY username, mngr_id"
SET rsusername = objConn.Execute(SQLQuery)		
			
If Not rsusername.eof THEN 

Reply With Quote
  #3  
Old May 13th, 2008, 08:16 AM
djfubar djfubar is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 416 djfubar User rank is Corporal (100 - 500 Reputation Level)djfubar User rank is Corporal (100 - 500 Reputation Level)djfubar User rank is Corporal (100 - 500 Reputation Level)djfubar User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 5 Days 2 h 5 m 49 sec
Reputation Power: 6
yep thats work great. thanks very much

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingASP Development > Recordset error "Exception occurred."


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 4 hosted by Hostway
Stay green...Green IT