Re: Passing An SQL Query to recordset?
- From: Dave@Yacc <DaveYacc@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 14 Jul 2005 08:58:03 -0700
righty having made progress i'm stuck again! I dont know why but i'm doing
seems to be a rare example, Im finding little answers in any literature I
have or any examples dotted about on the net!
basically i have this...
Set lst = Me!lstContacts
While Not m_rs.EOF
With lst
.RowSourceType = "Value List"
.RowSource = m_rs("ContactTitle") & " " & m_rs("ContactForename") & " "
& m_rs("ContactSurname")
m_rs.MoveNext
End With
Wend
Ofcourse this only sends the last record in the reportset to the list box, i
need to make it iterate through to return and print to the list box all the
records not just one! I'm stumped, tried various methods but all kicked off,
and im having to use rowsource because I dont have listbox.additem,
listbox.clear etc annoying!
again any advice appreciated!
"Dave@Yacc" wrote:
> I just realised i was looking at it from totally the wrong angle! The code i
> mentioned looking at basically does exactly what you described, which will
> infact do the job, i think fatigue is getting the better off me, thanks for
> the reply think im sorted!
>
> "Stephen Howe" wrote:
>
> > > i have a drop down list which selects and business and retrieves the
> > > business ID,
> > > i then have a query which recieves the id and retrieves all records from a
> > > contacts table that have the same ID, (basically all the people that we
> > can
> > > get in touch with from a particular business)
> >
> > Good. Wish everyone here would post an outline of the problem they are
> > trying to solve.
> >
> > > I need to know if it's therefore possible to send the results of this
> > query
> > > to a recordset in ADO?
> >
> > No. Basically you can setup a Command object which returns a recordset.
> > The Command object will have 1 parameter which is the ID and CommandText
> > will be set to the SQL query. Everytime you wish to get the records for a
> > new ID, you feed the Command object's parameter a new ID, call Execute and
> > the Recordset returned will be for that ID.
> >
> > The Recordset is likely to be Server-sided, ForwardOnly and ReadOnly.
> > If you want a Recordset with different properties, you can do it, but the
> > mechanics are slightly different.
> > You can still reuse the Recordset object mind you.
> >
> > Is this what you want?
> >
> > Stephen Howe
> >
> >
> >
.
- Follow-Ups:
- Re: Passing An SQL Query to recordset?
- From: Brendan Reynolds
- Re: Passing An SQL Query to recordset?
- From: Mark J. McGinty
- Re: Passing An SQL Query to recordset?
- References:
- Passing An SQL Query to recordset?
- From: Dave@Yacc
- Re: Passing An SQL Query to recordset?
- From: Stephen Howe
- Re: Passing An SQL Query to recordset?
- From: Dave@Yacc
- Passing An SQL Query to recordset?
- Prev by Date: Re: Problem executing Oracle SP from ASP page
- Next by Date: Re: Passing An SQL Query to recordset?
- Previous by thread: Re: Passing An SQL Query to recordset?
- Next by thread: Re: Passing An SQL Query to recordset?
- Index(es):
Relevant Pages
|