Re: query on recordset in visual basic




"Bob Barrows [MVP]" <reb01501@xxxxxxxxxxxxxxx> wrote in message
news:uC3OMpEWIHA.2000@xxxxxxxxxxxxxxxxxxxxxxx
ekkehard.horner wrote:
Someone is asking me to do a "query on a recordset" in VBScript,
claiming that in Visual Basic this

set conn=ADODB.connection
set rs1=ADODB.recordset
set rs2=ADODB.recordset
conn=<<set to someDB>>
rs1.open "select ename,age from emp"

rs2.open "select ename from rs1 where age >10"

msgbox rs2.recordcount

works. I doubt that - how could someDB know/access rs1 -
but not being familiar with Visual Basic, I thought it
wise to ask the experts.

You're correct. He is wrong. You need a database engine to compile and
run sql queries.

If it is possible in Visual Basic,

It's not VB that is the "bottleneck" here. ADODB is the class library
being used to access the database and retrieve the data, as well as
providing the functionality to work with the retrieved data. ADODB does
not provide database-engine functionality.

What you CAN do is utilize the Filter property to get near this
functionality:
http://msdn2.microsoft.com/en-us/library/ms676691(VS.85).aspx



lol

I totally missed "rs1" buried in the second query.

His last question now makes a bit of sense. Think I'll go get another cup.

-ralph


.



Relevant Pages

  • Re: query on recordset in visual basic
    ... being used to access the database and retrieve the data, ... providing the functionality to work with the retrieved data. ... Please reply to the newsgroup. ...
    (microsoft.public.data.ado)
  • Re: Customer asks for database password & link in
    ... customer, instead say "That will cost you an additional $$$ for the ... additional functionality", or "We cannot do exactly what you have requested, ... Your license to them must have a limitation on what they can do with your ... > one of my programs which holds a large database. ...
    (microsoft.public.vb.general.discussion)
  • Re: Too many fields?
    ... my laptop in and have been trying to build a database to use. ... depreciation ratios, along with the phyiscal, functional and external ... In a relational database, you would rarely find a table with more than 20 ... easier functionality out of Access. ...
    (microsoft.public.access.tablesdbdesign)
  • Re: VBA CODE - ADODB
    ... i have been looking at vb6 and ado and dao. ... i have looked at the coding for adodb - and it does ... > Dim dbShop As Database 'declare database object ... > Dim rsShop As Recordset 'declare recordset object ...
    (microsoft.public.vb.general.discussion)
  • Re: Database Alternative
    ... We built our engine with C#, using the subset of functionality available ... convenient to use the databinding functionality available with .NET. ... a database file. ... What do your customers use "GT40" for? ...
    (microsoft.public.dotnet.framework.compactframework)