Cannot Retrieve record from a recordset
ASP - Cannot Retrieve record from a 'single - record' recordset
ASP using an access db. I have create a recordset that will return a single record and I'm trying to retrieve that record. When I try to get the record it won't retrieve that value. This is only happening when it is one record in the recordset. The recordset is not at BOF or EOF. I have tried several different ways to retrieve the value as shown in my code and none of them work. Do anyone have any solutions or other alternatives. Need help ASAP, I have been working on this for several days. Below is the code:
Set rsHotFix2 = Server.CreateObject("ADODB.Recordset")
rsHotFix2.ActiveConnection = MM_AMT_DTS_STRING
rsHotFix2.Source = "SELECT Max([CID]) AS LastCID FROM WHERE(TCO_Contractors.SID= "&rsHirerachy__MMColParam&")"
rsHotFix2.CursorType = 0
rsHotFix2.CursorLocation = 2
rsHotFix2.LockType = 1
if rsHotFix2.bof and rsHotFix2.eof then
response.write "Recordset Is Empty"
response.write "Recordset Is Not Empty"
response.write rsHotFix2.Fields(0) & "<BR>"
response.write rsHotFix2.Fields("LastCID") & "<BR>"
response.write rsHotFix2.Fields.Item("LastCID") & "<BR>"
response.write rsHotFix2("LastCID") & "<BR>"
This is what's display on the page
Recordset Is Not Empty
Notice it does display the CID value.