|
-
Feb 16th, 2000, 11:23 PM
#1
Thread Starter
New Member
Hi,
I have a ADO recordset object which retreive data from database. now I want to run queries on that recordset. Is it possible to do this? if Yes, send me details. or any other alternative if anybody know (Momory Tables etc.)
Thanks.
-
Feb 16th, 2000, 11:43 PM
#2
New Member
Put a DataGrid on the form and connect it to the ADO control.
Make a button.
In the click event, simply type
Command1_Click()
Dim SomeVariable as String
SomeVariable = "Patrick"
Adodc1.DataSource="Select * FROM YourTable WHERE FirstName = '" & SomeVariable & "'"
Adodc1.Refresh
End Sub
Your DataGrid (eg. MSHFlex) should dynamically change and return all 'Patricks' in your 'FirstName' column
This works pretty consistently with adClient cursors, but with adServer cursors this may cause premature baldness.
-
Feb 17th, 2000, 01:38 AM
#3
Guru
No, no built-in function in an ADO RS... you'll need to requery the DB for the SUM (the best & fastest way) or do it manually on the client
-
Feb 17th, 2000, 12:44 PM
#4
Hyperactive Member
I'm using an ODBC DSN to connect to the database. Is there any way to connect a DataGrid or a FlexiGrid to a recordset without any datacontrol?
Thanks!
-
Feb 17th, 2000, 12:45 PM
#5
Guru
I believe you can set the FlexGrid.Recordsource to a recordset object at runtime.....
-
Feb 17th, 2000, 12:48 PM
#6
Thread Starter
New Member
Thanks for reply.
Actually, The query which your are sayinhg will again goto Database to retrieve data. Let me explain problem again.
Suppose, I have a recordset(Unbound mode : NOT bound to any database) which is filled with EmpNo, DeptNo, Salary by (Select * From EMP) query. Now I want to make summation of Salary.
I don't want to Parse each and every record to get the Sum(Salary).
( Result simmilar to query
Select SUM(Salary) from Emp )
One way is I will declare a variable, use MoveNext method till EOF and add salary in variables . But this will be take more time records in thousands. Now is there any in build function of ADO which will directly give me Summation of fields.
[This message has been edited by hi_vijay (edited 02-17-2000).]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|