Re: query on recordset in visual basic
- From: "Bob Barrows [MVP]" <reb01501@xxxxxxxxxxxxxxx>
- Date: Wed, 16 Jan 2008 09:15:48 -0500
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
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
.
- Follow-Ups:
- Re: query on recordset in visual basic
- From: Ralph
- Re: query on recordset in visual basic
- References:
- query on recordset in visual basic
- From: ekkehard.horner
- query on recordset in visual basic
- Prev by Date: Re: query on recordset in visual basic
- Next by Date: Re: query on recordset in visual basic
- Previous by thread: Re: query on recordset in visual basic
- Next by thread: Re: query on recordset in visual basic
- Index(es):
Relevant Pages
|