[thelist] Transversing a RecordSet from Multiple Tables

Rob Smith rob.smith at thermon.com
Mon Jun 17 07:41:01 CDT 2002


--
[ Picked text/plain from multipart/alternative ]

>Please send plain text only to the list.

I selected in M$ Outlook Format > Plain Text and I still get that "Please
Use Plain text" message at the top. Do you how I can fix this?

> Hi list,
>
> I've got a search across multiple tables for specific records and I'm
> getting an Object Required " response back from the browser. My guess is
> that the object I'm referencing wasn't returned in the RecordSet. For
> example:
>
> if NOT states.EOF then
>    states.movefirst
>    if SBU.SBUName <> NULL then   <------------------<<<
>      while (SBU.SBUName <> NULL OR NOT states.EOF)
>        response.write("<strong>" & SBU.SBUName & "</strong><br>" & vbCLRF)
> states.movenext
>      wend
>    end if
> end if
>
> The arrow points to the line where I'm getting the Object Required Error.
Is
> there a way I can detect if the object, SBU.SBUName, even exists in the
> RecordSet? As you can see, I'm just try to see if there is anything in it,
> if so, then write something, if not skip it.

You didn't show us how you set up your connection/recordset, so
assumption...
I assume SBU.SBUName is a field you queried for and 'states' is the
recordset.
The object needed is the recordset object - 'states'.
To show the field you want states("SBU.SBUName") or better
states.fields.item("SBU.SBUName").value


--
Lon Kraemer
-----------------------------------------
::::::::::::::::::::::::::::::::::::::::::::::::::::::::

Lon,

I used your suggestion:
if NOT states.EOF then
   states.movefirst
   if states.fields.item("SBUName").value <> NULL then  <----~~~---<<
     while (SBU.SBUName <> NULL OR NOT states.EOF)
       response.write("<strong>" & SBU.SBUName & "</strong><br>" & vbCLRF)
	   states.movenext
     wend
   end if
end if
but I excluded the "SBU." part in the second if statement and it worked. The
code was 'skipped' over at runtime, which is what it was supposed to do in
my tests. Previously, it would halt and suggest that
states.fields.item("SBU.SBUName").value was not in the RecordSet. removing
the "SBU." apparently solved it.

Thanks

Rob.Smith

--
For unsubscribe and other options, including
the Tip Harvester and archive of thelist go to:
http://lists.evolt.org Workers of the Web, evolt !



More information about the thelist mailing list