Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

INFORMATION_SCHEMA equivalent??

Status
Not open for further replies.

Mastakilla

Programmer
Nov 18, 2003
289
BE
Hi,

i'm using vb.2005 with a foxpro 9 database.

I'd like to list all the tables, views or stored procedures in that database. (I'd also like to list the columns for any given table).

If I had to do that on a MySQL or SQL database, I would make a SELECT on INFORMATION_SCHEMA.Tables(or INFORMATION_SCHEMA.Routines, or INFORMATION_SCHEMA.Columns) and it would do the trick.

Is there a way to retrieve this data from a foxPro database?

This is the first time I use foxPro.

Any help very much appreciated.


- Thanks -
 

Hi Mastakilla,

This is very easy to achieve, if you access to a copy of Visual FoxPro.

Assuming you have VFP, there are a bunch of commands and functions you can use. LIST DATABASE outputs the schema, excluding stored procedures, and can be redirected to a printer or text file. LIST PROCEDURES give you a similar list of the stored procedures. ADBOBJECTS() gives you an array containing most of the schema information.

If you don't have VFP, you might be able to find a utility that produces the required information. I've seen several of them over the years, but don't have any to hand at present.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
Mastakilla,

After posting the above, I checked the Compuserve library, and found the following:

dbc2wrd2.zip
Creates a Word document containing file structures and properties from a DBC. Great for documenting your databases and producing a data dictionary.

I should have remembered it, as I wrote a small bit of myself. Here's the link:


Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
Hi,

thanks for the answer but what i need is to retrieve this data in order to process it or display it in different user controls like combo boxes, listboxes, datagrids or gridviews etc... I can open the database with VFoxPro and read the info i need with my 'eyes' but i want that to be able to read the info with my vb program.
 
I've found the solution,

I just had to do the same thing i do when i want to retrieve the same info from an Access database:

simply use the GetSchema() function of the connection object....

Thanks for the effort anyway.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top