Can I get the fields in an Access table using just an SQL statement?

  • Thread starter Thread starter james
  • Start date Start date
J

james

Hi,
I know I can get the fields using openschema via ADO, but for various
reasons I could really do with getting the fields in table "x" with a simple
sql statement.
Any advice?
 
As far as I know, it cannot be done with just an SQL statement.

You could use some VBA to get the field names of a table. And that has been
posted elsewhere.
 
Hi, James.
I could really do with getting the fields in table "x" with a simple sql
statement.
Any advice?

The only way to get the column names of Jet tables with SQL is to use the
proprietary Jet API or write your own API. If you don't have those skills, you
can program a VBA function that uses the ADO or DAO library to retrieve all
column names, or you can upgrade the Jet tables to a client/server database that
supports metadata in system tables, such as Oracle or SQL Server.

I would suggest the ADO library's OpenSchema( ) function, since you're already
familiar with it.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact info.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top