|
-
Jan 18th, 2000, 08:45 AM
#1
Thread Starter
Lively Member
Hi,
How do I make a copy of a recordset with just the field names in it without any data?
I tried the Clone method but it does not seems to work with a declared recordset and a recordset from a Data control.
This is the code I used:
Dim rs as Recordset
set rs.Clone = Data1.Recordset
Thanks in advance.
-
Jan 19th, 2000, 02:53 PM
#2
Guru
Code:
Dim fld As DAO.Field
Dim tbl As DAO.TableDef
Set tbl = New TableDef
For Each fld In Data1.Recordset.Fields
tbl.Fields.Append tbl.CreateField(fld.Name, fld.Type, fld.Size)
Next fld
MsgBox tbl.Fields.Count
I don't know what you want to do with the tabledef afterwards, but there it is!
Tom
-
Jan 20th, 2000, 09:27 AM
#3
Frenzied Member
select *
insert into output_tbl
from input_tbl
where 1=0
works in SQL Server
-
Jan 25th, 2000, 04:44 AM
#4
Addicted Member
just a little modification to hausmann's suggestion, the code find VB-sql is:
SELECT * INTO outputtable
FROM inputtable WHERE False
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
|