sohelcsc
09-16-2001, 09:39 PM
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?
rich.barry
09-16-2001, 11:25 PM
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.
raskew
09-17-2001, 01:26 AM
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;
sohelcsc
09-17-2001, 02:50 AM
thanks,
yes, your statement is working.
thanks again
sohelcsc
Pat Hartman
09-17-2001, 03:56 PM
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.