The following piece of code don't work:
select table_name from user_tables;
--#1
EXEC sp_tables
--#2
SELECT *
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_TYPE = 'BASE_TABLE'
--#3
SELECT *
FROM sysobjects
WHERE xtype = 'u'
--
- Anith
( Please reply to newsgroups only )
To be picky it should be 'U'. 'u' will not work in case-sensitive databases.
--
Erland Sommarskog, SQL Server MVP, som...@algonet.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp
> Some options here...
>
> --#1
> EXEC sp_tables
>
error: table 'sp_tables' si not recognized
> --#2
> SELECT *
> FROM INFORMATION_SCHEMA.TABLES
> WHERE TABLE_TYPE = 'BASE_TABLE'
>
error: could not find file INFORMATION_SCHEMA.mdb
> --#3
> SELECT *
> FROM sysobjects
> WHERE xtype = 'u'
>
error: table 'sysobjets' is not recognized
> --
> - Anith
> ( Please reply to newsgroups only )
>
>
i am quering the datbase (ms access) using odbc with sql queries if that
might help you.
By the same time, I found another type of query that looks like to the 2n
one:
SELECT MSysObjects.Name, MSysObjects.Type
FROM MSysObjects
but i get error msg:
>>> no read access to 'MSysObjects' table
So how would i get the tables in the db or how do i configure the database
so that the MSysObject table is visible for read access?
Security is alos important, i don't want to show all table just to get this
feature working.
You posted your question to forum dedicated to SQL Server, and you did
not indicate that you are using something else. Thus, Anith gave you
the answer for SQL Server.
If you are using Access, you may want to try comp.databases.ms-access.
If you are using some other engine, you need to find a forum for that
DBMS.
Thanls for your help
-----------------------------------------------------------------
Look in the MSysObjects table (tools|options| check system objects). You
don't have to unhide the table to run the query, but it wouldn't hurt for
you to poke around those tables to see what info is available. Native
access tables are type 1. Attached access tables are type 6.
Select name, type from msysobjects where type = 1 or type = 6
Richard Bernstein
"swat42" <swa...@bit.com> wrote in
news:ETjPa.16788$Tx.8...@news20.bellglobal.com: