473,396 Members | 2,009 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

how to get the complete table schema including constraints thru SQL query

Hi ,

can anyone tell me how to get the complete table schema including
constraints, primary key ..etc.
through sql Query in Ms access.

We can get table information in MS SQL Server by means using sp_help.I
want to know the equivalent sql command for ms-access.

thanks in advance

Regards
visu

May 8 '07 #1
3 31544
Hi, Visu.
We can get table information in MS SQL Server by means using sp_help.I
want to know the equivalent sql command for ms-access.
SQL Server has system tables that contain information on each table's
structure. Access does not. Therefore, there are no system tables to query
with Jet SQL. Use the ADO and ADOX libraries, or the DAO library in VBA
instead. Use Tables and Indexes if using ADOX. Use TableDefs, Fields, and
the PrimaryKey Index if using DAO. One must use ADO's OpenSchema function
of the Connection object to retrieve the list of constraints, not DAO,
because it's not available in DAO.

If you just want the column names of a table, that's easy enough with SQL.
Try the following syntax to export the column names to a text file:

SELECT * INTO [TEXT;HDR=Yes;DATABASE=F:\Work\Test\].MyTable.txt
FROM MyTable
WHERE (1 = 0);

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
Blogs: www.DataDevilDog.BlogSpot.com, www.DatabaseTips.BlogSpot.com
http://www.Access.QBuilt.com/html/ex...ributors2.html for contact
info.
"visu" <k.******@gmail.comwrote in message
news:11*********************@e65g2000hsc.googlegro ups.com...
Hi ,

can anyone tell me how to get the complete table schema including
constraints, primary key ..etc.
through sql Query in Ms access.

We can get table information in MS SQL Server by means using sp_help.I
want to know the equivalent sql command for ms-access.

thanks in advance

Regards
visu

May 8 '07 #2
On May 8, 12:19 pm, "'69 Camaro" <ForwardZERO_SPAM.To.
69Cam...@Spameater.orgZERO_SPAMwrote:
Hi, Visu.
We can get table information in MS SQL Server by means using sp_help.I
want to know the equivalent sql command for ms-access.

SQL Server has system tables that contain information on each table's
structure. Access does not. Therefore, there are no system tables to query
with Jet SQL. Use the ADO and ADOX libraries, or the DAO library in VBA
instead. Use Tables and Indexes if using ADOX. Use TableDefs, Fields, and
the PrimaryKey Index if using DAO. One must use ADO's OpenSchema function
of the Connection object to retrieve the list of constraints, not DAO,
because it's not available in DAO.

If you just want the column names of a table, that's easy enough with SQL.
Try the following syntax to export the column names to a text file:

SELECT * INTO [TEXT;HDR=Yes;DATABASE=F:\Work\Test\].MyTable.txt
FROM MyTable
WHERE (1 = 0);

HTH.
Gunny

Seehttp://www.QBuilt.comfor all your database needs.
Seehttp://www.Access.QBuilt.comfor Microsoft Access tips and tutorials.
Blogs:http://www.DataDevilDog.BlogSpot.com...utors2.htmlfor contact
info.

"visu" <k.vis...@gmail.comwrote in message

news:11*********************@e65g2000hsc.googlegro ups.com...
Hi ,
can anyone tell me how to get the complete table schema including
constraints, primary key ..etc.
through sql Query in Ms access.
We can get table information in MS SQL Server by means using sp_help.I
want to know the equivalent sql command for ms-access.
thanks in advance
Regards
visu- Hide quoted text -

- Show quoted text -
thanks .. i ll try with ado.

Regards
Visu

May 8 '07 #3
You're welcome. Good luck with it.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
Blogs: www.DataDevilDog.BlogSpot.com, www.DatabaseTips.BlogSpot.com
http://www.Access.QBuilt.com/html/ex...ributors2.html for contact
info.
"visu" <k.******@gmail.comwrote in message
news:11*********************@h2g2000hsg.googlegrou ps.com...
On May 8, 12:19 pm, "'69 Camaro" <ForwardZERO_SPAM.To.
69Cam...@Spameater.orgZERO_SPAMwrote:
>Hi, Visu.
We can get table information in MS SQL Server by means using sp_help.I
want to know the equivalent sql command for ms-access.

SQL Server has system tables that contain information on each table's
structure. Access does not. Therefore, there are no system tables to
query
with Jet SQL. Use the ADO and ADOX libraries, or the DAO library in VBA
instead. Use Tables and Indexes if using ADOX. Use TableDefs, Fields,
and
the PrimaryKey Index if using DAO. One must use ADO's OpenSchema
function
of the Connection object to retrieve the list of constraints, not DAO,
because it's not available in DAO.

If you just want the column names of a table, that's easy enough with
SQL.
Try the following syntax to export the column names to a text file:

SELECT * INTO [TEXT;HDR=Yes;DATABASE=F:\Work\Test\].MyTable.txt
FROM MyTable
WHERE (1 = 0);

HTH.
Gunny

Seehttp://www.QBuilt.comfor all your database needs.
Seehttp://www.Access.QBuilt.comfor Microsoft Access tips and tutorials.
Blogs:http://www.DataDevilDog.BlogSpot.com...utors2.htmlfor
contact
info.

"visu" <k.vis...@gmail.comwrote in message

news:11*********************@e65g2000hsc.googlegr oups.com...
Hi ,
can anyone tell me how to get the complete table schema including
constraints, primary key ..etc.
through sql Query in Ms access.
We can get table information in MS SQL Server by means using sp_help.I
want to know the equivalent sql command for ms-access.
thanks in advance
Regards
visu- Hide quoted text -

- Show quoted text -

thanks .. i ll try with ado.

Regards
Visu

May 8 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: So Hok Chun, Bill | last post by:
Dear all, I am new to SQL programming. I'd like to know what are the usual practices in documenting the table schema. How to document relationship among tables? (by diagram or text...
2
by: Sgt. Sausage | last post by:
Quick question: Does SQL do table/schema changes "in place"? I've got a large table (140+ million rows of very wide data) that we want to change the schema on -- basically to remove a number...
2
by: Ajit | last post by:
Hi, My stored procedure was working fine but when i made added 2 fields to my table and then made subsequent changes to my sp it give me the following error: "Could not complete cursor...
0
by: Domenico Briganti | last post by:
Hello! Exist a tool for create a windows form for insert/modify/delete row in a table from a table schema? Thank Domenico
1
by: gaozj111 | last post by:
Hello: Now i want to rename the table schema for example: there is one table ,whose name is A.TEST,the A is the schema name, now i want to rename the A TO B. I want to get the B.TEST table.
13
by: N. Graves | last post by:
Thanks for taking time to read my questions. I'm looking for a way in Access that I could run a query that would return table schema information. Specifically I need to get the column name,...
22
by: klenwell | last post by:
I'm in the process of refactoring the php code base I've amassed over the last few years into an object-oriented framework. I'm about to start in on the authentication/login extension and I've...
13
by: amit2781 | last post by:
How can we get the table schema information in MYSQL 5.1.34? Like we use in ORACLE to get it as: OCIDescribeAny() // //get the describe handle for the table to be described. OCIAttrGet() ...
5
by: tasawer | last post by:
I need some assistance with SQL query. I will be grateful if you can provide help please. I have a database that records details of a road traffic accident and name of driver. sub-form records...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.