|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Empty Recordset Error
I am trying to run the following asp function:
Code:
Private Function GetAbs(dThisDate, lPartID) sql_abs = "SELECT AbsCode FROM Absence WHERE AbsDate = '" & dThisDate & "' AND PartID = " & lPartID Set rs_abs = conn.Execute(sql_abs) GetAbs = rs_abs(0).Value Set rs_abs = Nothing End Function It works fine if it finds a record but returns an error if it doesn't. How can I avoid this error? Thanks! |
|
#2
|
||||
|
||||
|
You can check to see if the recordset has any rows
If rs_abs.RecordCount > 0 then GetAbs = rs_abs(0).Value End If |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft SQL Server > Empty Recordset Error |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|