PDA

View Full Version : Creat a empty recordset



dhartford
12-18-2008, 10:40 PM
Is there any way to create a empty recordset (not table) with column headers only? I use ADO connection.

Thanks in advance

JimmyTheHand
12-19-2008, 01:08 AM
Where do the column headers come from?

dhartford
12-19-2008, 06:18 AM
Where do the column headers come from?

Hi JimmyTheHand, thank you for your reply.

The column headers are tx strings that I assign to them.

CreganTur
12-19-2008, 08:30 AM
this (http://episteme.arstechnica.com/eve/forums/a/tpc/f/6330927813/m/815002128731) has the information you want, as well as some good cautionary advice about creating empty recordsets.

dhartford
12-19-2008, 10:18 AM
this (http://episteme.arstechnica.com/eve/forums/a/tpc/f/6330927813/m/815002128731) has the information you want, as well as some good cautionary advice about creating empty recordsets.

Randy, thanks and it is very helpful. The empty rstB is created and also I populated the data to it.

Now my question is how to reference to rstB to create rstC.


strC = "Select Avg(Amount), [date] " & _
"From rstb " & _ '??????
"Group by [Date] "


Thanks again

CreganTur
12-19-2008, 10:32 AM
Now my question is how to reference to rstB to create rstC.

If you're wanting to populate this empty recordset and then run queries on it you would be better served to create a temporary table- less overhead and coding headaches. You can use SQL's DDL (Data Definition Language) to create the table and fields, then populate it either via more DDL or a recordset. Then you can release taht recordset and open a new one to query the temp table for what you want.

asingh
12-23-2008, 01:32 AM
Though why would you want to create an empty recordset..?...At runtime..?

Should not everything be defined within table structures..even if blank tables..?