C
carmen
I built a page where visitors can choose from a selection
of products and enter their state in order to receive a
list of nearby stores where their product is available.
All is fine with my code except when I encounter what I
believe is product without a corresponding record. If
someone selects such a product, I get the following error:
"ADODB.Field error '800a0bcd'
Either BOF or EOF is True, or the current record has been
deleted. Requested operation requires a current record."
Here's my code below, and though I have attempted
drafting a proper if/then statement to account for such
missing records, nothing is working quite right:
strSQL2="SELECT wtb_state.store FROM wtb_state INNER JOIN
wtb_item ON wtb_state.store=wtb_item.store WHERE state='"
& strSt & "' AND item='" & strItem & "'"
Set objConn = Server.CreateObject ("ADODB.Connection")
objConn.Open strConnect
Set objRS = objConn.Execute (strSQL2)
Do While Not objRS.EOF
Response.Write objRS("store") & "<BR>"
objRS.MoveNext
Loop
'ElseIf objRS.EOF then
'Response.Write "There are no nearby stores carrying your
product."
'End If
objRS.Close
objConn.Close
Set objRS = Nothing
Set objConn = Nothing
of products and enter their state in order to receive a
list of nearby stores where their product is available.
All is fine with my code except when I encounter what I
believe is product without a corresponding record. If
someone selects such a product, I get the following error:
"ADODB.Field error '800a0bcd'
Either BOF or EOF is True, or the current record has been
deleted. Requested operation requires a current record."
Here's my code below, and though I have attempted
drafting a proper if/then statement to account for such
missing records, nothing is working quite right:
strSQL2="SELECT wtb_state.store FROM wtb_state INNER JOIN
wtb_item ON wtb_state.store=wtb_item.store WHERE state='"
& strSt & "' AND item='" & strItem & "'"
Set objConn = Server.CreateObject ("ADODB.Connection")
objConn.Open strConnect
Set objRS = objConn.Execute (strSQL2)
Do While Not objRS.EOF
Response.Write objRS("store") & "<BR>"
objRS.MoveNext
Loop
'ElseIf objRS.EOF then
'Response.Write "There are no nearby stores carrying your
product."
'End If
objRS.Close
objConn.Close
Set objRS = Nothing
Set objConn = Nothing