|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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
|
|
#2
|
||||
|
||||
|
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)
|
|
#3
|
|||
|
|||
|
Quote:
Perfect, thanks. |
![]() |
| Viewing: ASP Free Forums > Programming > ASP Development > Database - General - ADODB.Field (0x800A0BCD) |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|