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:
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old May 13th, 2008, 09:56 AM
bigsur bigsur is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2006
Posts: 114 bigsur User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 13 h 5 m 4 sec
Reputation Power: 2
Database - General - ADODB.Field (0x800A0BCD)

I get the following error on pages that do not have a record
Error Type: ADODB.Field (0x800A0BCD)
Either BOF or EOF is True, or the current record has been deleted.

Should using If Isempty stop this happening?


Open Recordset
Code:
Dim getSubnav
Dim getSubnav_cmd
Dim getSubnav_numRows

Set getSubnav_cmd = Server.CreateObject ("ADODB.Command")
getSubnav_cmd.ActiveConnection = MM_connection_STRING
getSubnav_cmd.CommandText = "SELECT * FROM tbl_subnav WHERE navID = ?" 
getSubnav_cmd.Prepared = true
getSubnav_cmd.Parameters.Append getSubnav_cmd.CreateParameter("param1", 5, 1, -1, getSubnav__MMColParam) ' adDouble

Set getSubnav = getSubnav_cmd.Execute
getSubnav_numRows = 0



This works when there is a record
Code:
Dim subnaveg
subnaveg = (getSubnav.Fields.Item("subNavName").Value)
Response.Write(subnaveg)


Tried using If Isempty but following does not work
Code:
Dim subnaveg
subnaveg = (getSubnav.Fields.Item("subNavName").Value)
If Isempty(subnaveg) Then
Response.Write("")
Else
Response.Write(subnaveg)
End IF

Reply With Quote
  #2  
Old May 13th, 2008, 10:19 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
Click here for more information.
 
Join Date: Sep 2004
Location: Israel
Posts: 26,608 Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)  Folding Points: 325325 Folding Title: Super Ultimate Folder - Level 1Folding Points: 325325 Folding Title: Super Ultimate Folder - Level 1Folding Points: 325325 Folding Title: Super Ultimate Folder - Level 1Folding Points: 325325 Folding Title: Super Ultimate Folder - Level 1Folding Points: 325325 Folding Title: Super Ultimate Folder - Level 1Folding Points: 325325 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 1 Week 4 Days 12 h 53 m 47 sec
Reputation Power: 1400
IsEmpty won't help you.. what you need is the EOF property of the RecordSet:
Code:
Dim subnaveg
subnaveg = "some default value here"
If Not(getSubnav.EOF) Then
	subnaveg = getSubnav.Fields.Item("subNavName").Value
End If
Response.Write(subnaveg)
Comments on this post
bigsur agrees!

Reply With Quote
  #3  
Old May 13th, 2008, 10:50 AM
bigsur bigsur is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2006
Posts: 114 bigsur User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 13 h 5 m 4 sec
Reputation Power: 2
Quote:
Originally Posted by Shadow Wizard
IsEmpty won't help you.. what you need is the EOF property of the RecordSet:
Code:
Dim subnaveg
subnaveg = "some default value here"
If Not(getSubnav.EOF) Then
	subnaveg = getSubnav.Fields.Item("subNavName").Value
End If
Response.Write(subnaveg)


Perfect, thanks.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingASP Development > Database - General - ADODB.Field (0x800A0BCD)


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 2 hosted by Hostway