Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 188
Default Can I get all fields for all tables in a FoxPro DB into excel (one table per sheet) automatically?


Hi All,

Is there any way to get all tables (and all fields in each table) into
excel automatically without having to manually enter all table names
and field names into SELECT queries?

Ideally, one sheet per table with the sheets named with the table
names, but anything close would be good.

Thanks,

Alan.


--
The views expressed are my own, and not those of my employer or anyone
else associated with me.

My current valid email address is:



This is valid as is. It is not munged, or altered at all.

It will be valid for AT LEAST one month from the date of this post.

If you are trying to contact me after that time,
it MAY still be valid, but may also have been
deactivated due to spam. If so, and you want
to contact me by email, try searching for a
more recent post by me to find my current
email address



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default Can I get all fields for all tables in a FoxPro DB into excel (one

It is possible but would require some pretty intense coding which I don't
have time to work out right now. But the key would be using ADO to connect
to the database and then you can use the OpenSchema method to read the names
of the tables. You could iterate through these in a loop, append a worksheet
to your workbook, and then use standard ADO recordset methods to retrieve the
data from each table (SELECT * FROM TABLENAME should be sufficient). You
could get column headers, if desired, from the Field.Name property (iterating
through the fields).

Sorry I can't do all the details, but for info on reading the database
schema see this:
http://msdn.microsoft.com/library/de...openschema.asp

If you need info on ADO methods in general:
http://msdn.microsoft.com/library/de...troduction.asp
--
- K Dales


"Alan" wrote:


Hi All,

Is there any way to get all tables (and all fields in each table) into
excel automatically without having to manually enter all table names
and field names into SELECT queries?

Ideally, one sheet per table with the sheets named with the table
names, but anything close would be good.

Thanks,

Alan.


--
The views expressed are my own, and not those of my employer or anyone
else associated with me.

My current valid email address is:



This is valid as is. It is not munged, or altered at all.

It will be valid for AT LEAST one month from the date of this post.

If you are trying to contact me after that time,
it MAY still be valid, but may also have been
deactivated due to spam. If so, and you want
to contact me by email, try searching for a
more recent post by me to find my current
email address




Reply
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
Pivot tables missing fields from defined table Emma Excel Discussion (Misc queries) 2 October 31st 08 01:32 PM
Pivot Table Cycling Through Page Fields Automatically nrehman Excel Discussion (Misc queries) 14 October 13th 05 07:32 PM
automatically change the order of fields in a sheet minrufeng[_5_] Excel Programming 1 August 14th 05 09:39 PM
Mapping Tables.Fields from a data source to my MS Access Table Structure Mark Roach Excel Programming 0 April 9th 05 11:03 PM
Excel 2003 and FoxPro tables WKIII Excel Programming 1 June 15th 04 04:55 PM


All times are GMT +1. The time now is 02:04 AM.

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"