Re: query on recordset in visual basic

Tech-Archive recommends: Fix windows errors by optimizing your registry



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.


.



Relevant Pages

  • Re: query on recordset in visual basic
    ... ADODB is the class library ... being used to access the database and retrieve the data, ... providing the functionality to work with the retrieved data. ...
    (microsoft.public.data.ado)
  • RE: Restore public folders and companyweb
    ... Thank you for posting in the SBS newsgroup. ... I understand that the Public Folder Store ... database cannot be mounted due to integrity problems, ...
    (microsoft.public.windows.server.sbs)
  • RE: Companyweb caanot load
    ... Welcome to SBS newsgroup. ... Check the database connection ... As you could not access the companyweb any more, ... Microsoft CSS Online Newsgroup Support ...
    (microsoft.public.windows.server.sbs)
  • RE: Scecli and jet database event 1005 and 1202 repeating
    ... This issue occurs if the local Group Policy database file is corrupt. ... Microsoft CSS Online Newsgroup Support ... Open the %SystemRoot%\Security folder, create a new folder, and then ...
    (microsoft.public.windows.server.sbs)
  • RE: Move the monitoring database
    ... Microsoft CSS Online Newsgroup Support ... This newsgroup only focuses on SBS technical issues. ... | Thread-Topic: Move the monitoring database ... | for Windows Small Business Server 2003" document only specifies moving ...
    (microsoft.public.windows.server.sbs)