Query for only recordset definition

HardCode
04-16-2004, 12:28 PM
For the life of me, I can't remember the WHERE clause to use when you want the recordset to return empty, with only the recordset definition (field names, data types, etc.) Is it "WHERE 1 = 0" or is it "WHERE 0 = 0" or something like that?

ed_creed
04-16-2004, 01:38 PM
For the life of me, I can't remember the WHERE clause to use when you want the recordset to return empty, with only the recordset definition (field names, data types, etc.) Is it "WHERE 1 = 0" or is it "WHERE 0 = 0" or something like that?


where 1 = 2 or anything similar would work.

MKoslof
04-16-2004, 07:21 PM
I believe you are looking for this:



"select * from myTable where 1=0"

HardCode
04-19-2004, 09:17 AM
That's it! Thanks guys.

MKoslof
04-19-2004, 09:22 AM
No problem, I do queries like this when I need to return field names :). I assume this is along the lines of what you need..or something that returns no physical data from the table.

HardCode
04-19-2004, 09:33 AM
Yes. I wanted to iterate through each field of a recordset and add the field names into a combo box, without bringing over unnecessary data.

MKoslof
04-19-2004, 09:42 AM
Yep... you got it. That will work fine.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum