Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004
    Posts
    2

    Question Unanswered: getting table attributes with SQL query in MS Access

    Does anyone know if there's any way to get a table's attribute names using an SQL query?


    i found that i can get the tables names using this query:


    SELECT Name from MSysObjects where Type = 1

    but how can i get the table attributes?




    Any help?

  2. #2
    Join Date
    Mar 2004
    Location
    www.scirocco.ca
    Posts
    346

    Re: getting table attributes with SQL query in MS Access

    Just run these strored-procedures that will return all the attributes that you need:

    sp_column_privileges Information about column privileges for the specified table or tables.

    sp_columns Information about columns for the specified table or tables.

    sp_databases A list of databases.

    sp_datatype_info Information about the datatypes (used only by the Open Data Services ODBC driver if the resources DLL does not contain this information).

    sp_fkeys Information about foreign keys.

    sp_pkeys Information about primary keys.

    sp_server_info A list of attribute names and matching values for
    the server (only attributes 1, 2, and 500 are used by the Open Data Services ODBC driver).

    sp_special_columns Information for a single table about columns in the table that have special attributes.

    sp_sproc_columns Column information for a stored procedure.

    sp_statistics A list of indexes for a single table.

    sp_stored_procedures A list of stored procedures.

    sp_table_privileges Information about table privileges for the
    specified table or tables.

    sp_tables A list of objects that can be queried.
    http://www.scirocco.ca/images/banner...occobanner.gif

    Download for FREE the ADO/DAO Data Controls that makes life EASIER developing database applications in: VB, FoxPro, Access, VC++, .NET etc... Navigate, Add New, Delete, Update, Search, Undo and Save your changes. Supports Disconnected Recordsets and Transactions!

    Or try our Ask An Expert service to answer any of your questions!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •