
Is there a way to execute an SQL statement on a recordset?
Hi all,
I know that you can connect to a database and create a recordset thru an SQL
string, but say you have a recordset and you want to quicly retrieve sums,
averages or create a groupped recordset.
Suppose you have saved an ADO recordset thru the save method in the default
adtg format.
Now you want to query that recordset to get info about specific columns,
such as sums or counts.
In my mind that would be something like this:
Dim MyConn As ADODB.Connection
Set MyConn = CreateObject("ADODB.Connection")
MyConn.Open "Provider=MSPersist;"
' bogus, this won't work
sql = "SELECT `Quantity`, COUNT(`Quantity`) AS MyTable FROM 'C:\Test.vbd'"
Set rsTotals = MyConn.Execute(sql)
Obviously this doesn't work.
Is there a way?
Thanks,
Andy.