i need some SQL statemetns

  • Thread starter Thread starter sohelcsc
  • Start date Start date
S

sohelcsc

Guest
i am facing a problem with Access. that is if i want to retrieve all the table name from one specific database then what will be the sql comman:
in oracle it is : select * from tabl;
but in Access what?

another question: how can i retrieve column name from a table by a sql statement:
in oracle it is: DESC TABlE_Name;
but what in Access?
 
The quickest way to come to grips with Access SQL is to create some queries using design view, get them showing the results you are after, then click View...SQL View, and it will display the same query in SQL notation.
Of course SQL is more powerful than Bill Gates design view, so if you modify the SQL statement to something too extreme, it will not give you the option of going back to design view if it can't figure out how to give you a tabular representation - the query will still function fine however.
 
This query SQL will provide a list of table names.

SELECT MSysObjects.Name, MSysObjects.Type
FROM MSysObjects
WHERE (((MSysObjects.Type)=1) AND ((Left([Name],4))<>"MSys"))
ORDER BY MSysObjects.Name;
 
Here is a link to a more complete example that I posted some time ago.
http://www.access-programmers.co.uk/ubb/Forum1/HTML/000388.html

Access no longer mantains a MSysColumns table where in previous verisons it stored column information for tables. To retrieve the column information you will need to write VBA code to read the Fields collection of the tabledef object. Help will give you example subroutines.
 

Users who are viewing this thread

Back
Top Bottom