LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default testing ADO recordset for PrimaryKeys

On Jan 11, 5:36*pm, Jeff Norville wrote:
I'm pulling a recordset of data based on a query into Excel; currently
I flip through the Field.Name and Field.Type properties to populate
the header rows with recordset names and types (enumerating the types
as adInteger, adVarWChar, adBoolean, etc).

I don't find a way to test the recordset to see if the field came from
a table's primary key... *which doesn't seem too taxing.

Looks like I would need to go to ADODB.Connection.OpenSchema and test
the originating table to find its keys. *Could that be right?

Feels like I am missing something obvious, but I hope you'll humor the
question anyway!

Thanks,
Jeff


Hi Jeff,

I didnt get exactly what is your doubt, but incase if you are looking
for the heading
you can try this or make your question bit more clear -
Open your RecordSet and do the below loop before it pasting to your
destination
For ColH = 1 To RecordSet(Name of your Recordset).Fields.Count
Sheets("YourSheet").Cells(1, ColH) = RecSet.Fields(ColH -
1).Name
Next

Regards
Ratheesh
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot use recordset twice with copy From recordset JasonC Excel Programming 1 February 3rd 10 11:53 PM
ADO Recordset Tim Excel Programming 0 March 9th 09 04:03 PM
ADO recordset Kirk P. Excel Programming 2 April 6th 07 07:22 PM
Need ADO Recordset Help Mr B[_2_] Excel Programming 9 April 21st 06 04:51 PM
Type recordset/recordset? FlaviusFlav[_9_] Excel Programming 4 May 24th 04 12:16 PM


All times are GMT +1. The time now is 04:26 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"