Sign Up |  Live StatsLive Stats    Articles 35,345| Comments 159,790| Members 17,820, Newest waheguruhelpme| Online 226
Home Contact
 (Forgotten?): 
    Sikhism

   
                                                                     Your Banner Here!    

Interesting SQL commands

Our Donation Goal : Why Donate? : Donate Today! : Donate Anonymously (ਗੁਪਤ) : Our Family of Supporters
Goal this month: 400 USD, Received: 35 USD (9%)
Please Donate...
Related Topics...
Thread Thread Starter Forum Replies Last Post
Re: Commands in Reports PB Information Technology 0 28-Jul-2006 08:30 AM
Is there any way to run multiple SQL commands in Access 2003 Rod Information Technology 2 28-Jul-2006 08:17 AM
Re: Controlling Access with external commands Larry Linson Information Technology 0 28-Jul-2006 08:00 AM
Switchboard Commands anaguiu Information Technology 0 15-Nov-2005 14:10 PM
RE: Commands in Reports J. Kando 411 Information Technology 0 08-Nov-2005 12:52 PM


Tags
interesting, sql, commands
Reply Post New Topic In This Forum Stay Connected to Sikhism, Click Here to Register Now!
  #1 (permalink)  
Old 28-Jul-2006, 08:42 AM
Cicada's Avatar Cicada
Guest
 
Posts: n/a
   
   
Interesting SQL commands

  Donate Today!   Email to Friend  Tell a Friend   Show Printable Version  Print   Contact sikhphilosophy.net Administraion for any Suggestions, Ideas, Feedback.  Feedback  

Register to Remove Advertisements
Today I see a PostgreSQL SQL book and find some interesting commands below.
Is there any similar SQL commands under ADO??

1. Meta-Command
\d_\dt List All TAbles
\dv List All View
...... List All Query (equal to View??)
...... List All Users

2. Frequency Statistic
Select n_distinct, most_common_vals, most_common_freqs FROM .....
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/information-technology/14007-interesting-sql-commands.html
==> these 3 terms are system terms. Result is showing N-th data/value
occuring with top frequency in a table's field.

Besides, please help:
3. There is a System table in MS Access "MsysObjects".
I can open it in MS Access easily, without any password needed, but not
in my application.
How to solve it?

4. I have searched through Google with keywords SQL ADO or SQL "OLE DB", I
feel very strange that there is only a few data for the former, and None for
the latter.
Even though their ultimate data engine may be ODBC or Jet, their SQL
language in User-Level should be defined by themselves.
(Otherwise, there will not be so many SQL language around MS
applications :> )
Could you introduce me any tutorial and handbook web site for it??
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=14007





 
Do share your immediate thoughts or reactions on this issue? We value your views! Login Now! or Sign Up Today! to share your views with us.. Gurfateh!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 28-Jul-2006, 08:42 AM
Pieter Wijnen's Avatar Pieter Wijnen
Guest
 
Posts: n/a
   
   
Re: Interesting SQL commands

For all Tables
Create a new Query ( MSysObjects is hidden - leave it so - can be changed
through tools/options/show hidden objects)
Hit cancel for the table selection
View SQL
Write SELECT Name From MSYSOBJECTS A WHERE A.TYPE IN (1,6,4)
This will give you all the tables (native, Linked, ODBC)

For Queries (Views)
SELECT A.NameFROM MSYSOBJECTS A WHERE EXISTS ( SELECT 'X' FROM MSysQueries
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=14007
B WHERE B.ObjectId =A.Id)

To get all the users you'll need to use VB Code:

Sub CreateUserTable()
Dim Ws As DAO.WorkSpace
Dim Db As DAO.Database
Dim Usr As DAO.User

Set Ws = DAO.DbEngine.Workspaces(0)
Set Db = CurrentDb
Db.Execute "DROP Table USysUsers"
Db.Execute "CREATE TABLE USysUsers (UserName char(32))"
Db.Execute "CREATE UNIQUE INDEX PK_USysTable ON USysUsers (UserName) With
Primary"

For Each Usr In Ws.Users
Db.Execute "INSERT INTO USysusers (UserName) VALUES ('" & Usr.Name & "')"
Next ' Usr

Set Db = Nothing
Set Ws = Nothing
End Sub

now you can use (to show users - including "internal users" - Engine,
Creator)
SELECT UserName FROM USysUsers

For MSSQL, Oracle(8i +) you can query:
INFORMATION_SCHEMA.TABLES etc
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=14007

Pieter


"Cicada" wrote in message
news:uEl%23O5PsGHA.4444@TK2MSFTNGP06.phx.gbl...
> Today I see a PostgreSQL SQL book and find some interesting commands
> below.
> Is there any similar SQL commands under ADO??
>
> 1. Meta-Command
> \d_\dt List All TAbles
> \dv List All View
> ...... List All Query (equal to View??)
> ...... List All Users
>
> 2. Frequency Statistic
> Select n_distinct, most_common_vals, most_common_freqs FROM .....
> ==> these 3 terms are system terms. Result is showing N-th data/value
> occuring with top frequency in a table's field.
>
> Besides, please help:
> 3. There is a System table in MS Access "MsysObjects".
> I can open it in MS Access easily, without any password needed, but not
> in my application.
> How to solve it?
>
> 4. I have searched through Google with keywords SQL ADO or SQL "OLE DB", I
> feel very strange that there is only a few data for the former, and None
> for the latter.
> Even though their ultimate data engine may be ODBC or Jet, their SQL
> language in User-Level should be defined by themselves.
> (Otherwise, there will not be so many SQL language around MS
> applications :> )
> Could you introduce me any tutorial and handbook web site for it??
>



Reply With Quote
  #3 (permalink)  
Old 28-Jul-2006, 08:42 AM
Pieter Wijnen's Avatar Pieter Wijnen
Guest
 
Posts: n/a
   
   
Re: Interesting SQL commands

For all Tables
Create a new Query ( MSysObjects is hidden - leave it so - can be changed
through tools/options/show hidden objects)
Hit cancel for the table selection
View SQL
Write SELECT Name From MSYSOBJECTS A WHERE A.TYPE IN (1,6,4)
This will give you all the tables (native, Linked, ODBC)

For Queries (Views)
SELECT A.NameFROM MSYSOBJECTS A WHERE EXISTS ( SELECT 'X' FROM MSysQueries
B WHERE B.ObjectId =A.Id)

To get all the users you'll need to use VB Code:

Sub CreateUserTable()
Dim Ws As DAO.WorkSpace
Dim Db As DAO.Database
Dim Usr As DAO.User

Set Ws = DAO.DbEngine.Workspaces(0)
Set Db = CurrentDb
Db.Execute "DROP Table USysUsers"
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=14007
Db.Execute "CREATE TABLE USysUsers (UserName char(32))"
Db.Execute "CREATE UNIQUE INDEX PK_USysTable ON USysUsers (UserName) With
Primary"

For Each Usr In Ws.Users
Db.Execute "INSERT INTO USysusers (UserName) VALUES ('" & Usr.Name & "')"
Next ' Usr

Set Db = Nothing
Set Ws = Nothing
End Sub

now you can use (to show users - including "internal users" - Engine,
Creator)
SELECT UserName FROM USysUsers

For MSSQL, Oracle(8i +) you can query:
INFORMATION_SCHEMA.TABLES etc

Pieter


"Cicada" wrote in message
news:uEl%23O5PsGHA.4444@TK2MSFTNGP06.phx.gbl...
> Today I see a PostgreSQL SQL book and find some interesting commands
> below.
> Is there any similar SQL commands under ADO??
>
> 1. Meta-Command
> \d_\dt List All TAbles
> \dv List All View
> ...... List All Query (equal to View??)
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=14007
> ...... List All Users
>
> 2. Frequency Statistic
> Select n_distinct, most_common_vals, most_common_freqs FROM .....
> ==> these 3 terms are system terms. Result is showing N-th data/value
> occuring with top frequency in a table's field.
>
> Besides, please help:
> 3. There is a System table in MS Access "MsysObjects".
> I can open it in MS Access easily, without any password needed, but not
> in my application.
> How to solve it?
>
> 4. I have searched through Google with keywords SQL ADO or SQL "OLE DB", I
> feel very strange that there is only a few data for the former, and None
> for the latter.
> Even though their ultimate data engine may be ODBC or Jet, their SQL
> language in User-Level should be defined by themselves.
> (Otherwise, there will not be so many SQL language around MS
> applications :> )
> Could you introduce me any tutorial and handbook web site for it??
>




--
----------------------------------------
I am using the free version of SPAMfighter for private users.
It has removed 4367 spam emails to date.
Paying users do not have this message in their emails.
Get the free SPAMfighter here: http://www.spamfighter.com/len


Reply With Quote
  #4 (permalink)  
Old 28-Jul-2006, 08:42 AM
david epsom dot com dot au's Avatar david epsom dot com dot au
Guest
 
Posts: n/a
   
   
Re: Interesting SQL commands

Use the syscmd to find the workgroup database, then
open the user list table in the workgroup database

(david)

"Pieter Wijnen"

wrote in message news:u6itDMQsGHA.904@TK2MSFTNGP03.phx.gbl...
> For all Tables
> Create a new Query ( MSysObjects is hidden - leave it so - can be changed
> through tools/options/show hidden objects)
> Hit cancel for the table selection
> View SQL
> Write SELECT Name From MSYSOBJECTS A WHERE A.TYPE IN (1,6,4)
> This will give you all the tables (native, Linked, ODBC)
>
> For Queries (Views)
> SELECT A.NameFROM MSYSOBJECTS A WHERE EXISTS ( SELECT 'X' FROM
> MSysQueries B WHERE B.ObjectId =A.Id)
>
> To get all the users you'll need to use VB Code:
>
> Sub CreateUserTable()
> Dim Ws As DAO.WorkSpace
> Dim Db As DAO.Database
> Dim Usr As DAO.User
>
> Set Ws = DAO.DbEngine.Workspaces(0)
> Set Db = CurrentDb
> Db.Execute "DROP Table USysUsers"
> Db.Execute "CREATE TABLE USysUsers (UserName char(32))"
> Db.Execute "CREATE UNIQUE INDEX PK_USysTable ON USysUsers (UserName) With
> Primary"
>
> For Each Usr In Ws.Users
> Db.Execute "INSERT INTO USysusers (UserName) VALUES ('" & Usr.Name & "')"
> Next ' Usr
>
> Set Db = Nothing
> Set Ws = Nothing
> End Sub
>
> now you can use (to show users - including "internal users" - Engine,
> Creator)
> SELECT UserName FROM USysUsers
>
> For MSSQL, Oracle(8i +) you can query:
> INFORMATION_SCHEMA.TABLES etc
>
> Pieter
>
>
> "Cicada" wrote in message
> news:uEl%23O5PsGHA.4444@TK2MSFTNGP06.phx.gbl...
>> Today I see a PostgreSQL SQL book and find some interesting commands
>> below.
>> Is there any similar SQL commands under ADO??
>>
>> 1. Meta-Command
>> \d_\dt List All TAbles
>> \dv List All View
>> ...... List All Query (equal to View??)
>> ...... List All Users
>>
>> 2. Frequency Statistic
>> Select n_distinct, most_common_vals, most_common_freqs FROM .....
>> ==> these 3 terms are system terms. Result is showing N-th data/value
>> occuring with top frequency in a table's field.
>>
>> Besides, please help:
>> 3. There is a System table in MS Access "MsysObjects".
>> I can open it in MS Access easily, without any password needed, but
>> not in my application.
>> How to solve it?
>>
>> 4. I have searched through Google with keywords SQL ADO or SQL "OLE DB",
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=14007
>> I feel very strange that there is only a few data for the former, and
>> None for the latter.
>> Even though their ultimate data engine may be ODBC or Jet, their SQL
>> language in User-Level should be defined by themselves.
>> (Otherwise, there will not be so many SQL language around MS
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=14007
>> applications :> )
>> Could you introduce me any tutorial and handbook web site for it??
>>

>
>



Reply With Quote
  #5 (permalink)  
Old 28-Jul-2006, 08:42 AM
John Vinson's Avatar John Vinson
Guest
 
Posts: n/a
   
   
Re: Interesting SQL commands

On Thu, 27 Jul 2006 0507 +0800, "Cicada"
wrote:

>Today I see a PostgreSQL SQL book and find some interesting commands below.
>Is there any similar SQL commands under ADO??


Not really... but Tools... Analyze... Documentor will show you all
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=14007
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=14007
this information and more (too much information actually, you should
check the options before printing!)

John W. Vinson[MVP]
Reply With Quote
  #6 (permalink)  
Old 28-Jul-2006, 08:42 AM
Cicada's Avatar Cicada
Guest
 
Posts: n/a
   
   
Re: Interesting SQL commands

As I state in Point 3, I can view (not hidden) MsysObjects table in both
Access & my application (ADO-based),
but I can just OPEN it in Access, but not in my application, and error
message is "No authorization ro read". (but I have not set any
authorization level myself)
(This application is not not programmed by me, but a standard database
application very similar to Access).

How to solve it 1st??


"Pieter Wijnen"

¼¶¼g©ó¶l¥ó·s»D:u6itDMQsGHA.904@TK2MSFTNGP03.phx.gb l...
> For all Tables
> Create a new Query ( MSysObjects is hidden - leave it so - can be changed
> through tools/options/show hidden objects)
> Hit cancel for the table selection
> View SQL
> Write SELECT Name From MSYSOBJECTS A WHERE A.TYPE IN (1,6,4)
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=14007
> This will give you all the tables (native, Linked, ODBC)
>
> For Queries (Views)
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=14007
> SELECT A.NameFROM MSYSOBJECTS A WHERE EXISTS ( SELECT 'X' FROM
> MSysQueries B WHERE B.ObjectId =A.Id)
>
> To get all the users you'll need to use VB Code:
>
> Sub CreateUserTable()
> Dim Ws As DAO.WorkSpace
> Dim Db As DAO.Database
> Dim Usr As DAO.User
>
> Set Ws = DAO.DbEngine.Workspaces(0)
> Set Db = CurrentDb
> Db.Execute "DROP Table USysUsers"
> Db.Execute "CREATE TABLE USysUsers (UserName char(32))"
> Db.Execute "CREATE UNIQUE INDEX PK_USysTable ON USysUsers (UserName) With
> Primary"
>
> For Each Usr In Ws.Users
> Db.Execute "INSERT INTO USysusers (UserName) VALUES ('" & Usr.Name & "')"
> Next ' Usr
>
> Set Db = Nothing
> Set Ws = Nothing
> End Sub
>
> now you can use (to show users - including "internal users" - Engine,
> Creator)
> SELECT UserName FROM USysUsers
>
> For MSSQL, Oracle(8i +) you can query:
> INFORMATION_SCHEMA.TABLES etc
>
> Pieter
>
>
> "Cicada" wrote in message
> news:uEl%23O5PsGHA.4444@TK2MSFTNGP06.phx.gbl...
>> Today I see a PostgreSQL SQL book and find some interesting commands
>> below.
>> Is there any similar SQL commands under ADO??
>>
>> 1. Meta-Command
>> \d_\dt List All TAbles
>> \dv List All View
>> ...... List All Query (equal to View??)
>> ...... List All Users
>>
>> 2. Frequency Statistic
>> Select n_distinct, most_common_vals, most_common_freqs FROM .....
>> ==> these 3 terms are system terms. Result is showing N-th data/value
>> occuring with top frequency in a table's field.
>>
>> Besides, please help:
>> 3. There is a System table in MS Access "MsysObjects".
>> I can open it in MS Access easily, without any password needed, but
>> not in my application.
>> How to solve it?
>>
>> 4. I have searched through Google with keywords SQL ADO or SQL "OLE DB",
>> I feel very strange that there is only a few data for the former, and
>> None for the latter.
>> Even though their ultimate data engine may be ODBC or Jet, their SQL
>> language in User-Level should be defined by themselves.
>> (Otherwise, there will not be so many SQL language around MS
>> applications :> )
>> Could you introduce me any tutorial and handbook web site for it??
>>

>
>



Reply With Quote
  #7 (permalink)  
Old 28-Jul-2006, 08:42 AM
Pieter Wijnen's Avatar Pieter Wijnen
Guest
 
Posts: n/a
   
   
Re: Interesting SQL commands

Oh yeah I forgot about that, silly me
you can query MSysAccounts in the system.mdw (workGroup file), to find the
users (do it myself - I must admit)

For Users:
SELECT A.NAME FROM MSYSACCOUNTS A WHERE FGROUP = 0

For Groups (Roles)
SELECT A.NAME FROM MSYSACCOUNTS A WHERE FGROUP <>0

For User/Roles (Membership):
SELECT G.Name AS GroupName, U.Name AS UserName
FROM (MSysAccounts U INNER JOIN MSysGroups UG ON U.SID = UG.UserSID) INNER
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=14007
JOIN MSysAccounts G ON UG.GroupSID = G.SID
WHERE U.FGroup=0 AND G.FGroup<>0

Pieter

"Cicada" wrote in message
news:%23eo0JjUsGHA.4784@TK2MSFTNGP04.phx.gbl...
> As I state in Point 3, I can view (not hidden) MsysObjects table in both
> Access & my application (ADO-based),
> but I can just OPEN it in Access, but not in my application, and error
> message is "No authorization ro read". (but I have not set any
> authorization level myself)
> (This application is not not programmed by me, but a standard database
> application very similar to Access).
>
> How to solve it 1st??
>
>
> "Pieter Wijnen"
>
> ¼¶¼g©ó¶l¥ó·s»D:u6itDMQsGHA.904@TK2MSFTNGP03.phx.gb l...
>> For all Tables
>> Create a new Query ( MSysObjects is hidden - leave it so - can be
>> changed through tools/options/show hidden objects)
>> Hit cancel for the table selection
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=14007
>> View SQL
>> Write SELECT Name From MSYSOBJECTS A WHERE A.TYPE IN (1,6,4)
>> This will give you all the tables (native, Linked, ODBC)
>>
>> For Queries (Views)
>> SELECT A.NameFROM MSYSOBJECTS A WHERE EXISTS ( SELECT 'X' FROM
>> MSysQueries B WHERE B.ObjectId =A.Id)
>>
>> To get all the users you'll need to use VB Code:
>>
>> Sub CreateUserTable()
>> Dim Ws As DAO.WorkSpace
>> Dim Db As DAO.Database
>> Dim Usr As DAO.User
>>
>> Set Ws = DAO.DbEngine.Workspaces(0)
>> Set Db = CurrentDb
>> Db.Execute "DROP Table USysUsers"
>> Db.Execute "CREATE TABLE USysUsers (UserName char(32))"
>> Db.Execute "CREATE UNIQUE INDEX PK_USysTable ON USysUsers (UserName) With
>> Primary"
>>
>> For Each Usr In Ws.Users
>> Db.Execute "INSERT INTO USysusers (UserName) VALUES ('" & Usr.Name &
>> "')"
>> Next ' Usr
>>
>> Set Db = Nothing
>> Set Ws = Nothing
>> End Sub
>>
>> now you can use (to show users - including "internal users" - Engine,
>> Creator)
>> SELECT UserName FROM USysUsers
>>
>> For MSSQL, Oracle(8i +) you can query:
>> INFORMATION_SCHEMA.TABLES etc
>>
>> Pieter
>>
>>
>> "Cicada" wrote in message
>> news:uEl%23O5PsGHA.4444@TK2MSFTNGP06.phx.gbl...
>>> Today I see a PostgreSQL SQL book and find some interesting commands
>>> below.
>>> Is there any similar SQL commands under ADO??
>>>
>>> 1. Meta-Command
>>> \d_\dt List All TAbles
>>> \dv List All View
>>> ...... List All Query (equal to View??)
>>> ...... List All Users
>>>
>>> 2. Frequency Statistic
>>> Select n_distinct, most_common_vals, most_common_freqs FROM .....
>>> ==> these 3 terms are system terms. Result is showing N-th data/value
>>> occuring with top frequency in a table's field.
>>>
>>> Besides, please help:
>>> 3. There is a System table in MS Access "MsysObjects".
>>> I can open it in MS Access easily, without any password needed, but
>>> not in my application.
>>> How to solve it?
>>>
>>> 4. I have searched through Google with keywords SQL ADO or SQL "OLE DB",
>>> I feel very strange that there is only a few data for the former, and
>>> None for the latter.
>>> Even though their ultimate data engine may be ODBC or Jet, their SQL
>>> language in User-Level should be defined by themselves.
>>> (Otherwise, there will not be so many SQL language around MS
>>> applications :> )
>>> Could you introduce me any tutorial and handbook web site for it??
>>>

>>
>>

>
>



Reply With Quote
  #8 (permalink)  
Old 28-Jul-2006, 08:42 AM
Pieter Wijnen's Avatar Pieter Wijnen
Guest
 
Posts: n/a
   
   
Re: Interesting SQL commands

Oh yeah I forgot about that, silly me
you can query MSysAccounts in the system.mdw (workGroup file), to find the
users (do it myself - I must admit)

For Users:
SELECT A.NAME FROM MSYSACCOUNTS A WHERE FGROUP = 0

For Groups (Roles)
SELECT A.NAME FROM MSYSACCOUNTS A WHERE FGROUP <>0

For User/Roles (Membership):
SELECT G.Name AS GroupName, U.Name AS UserName
FROM (MSysAccounts U INNER JOIN MSysGroups UG ON U.SID = UG.UserSID) INNER
JOIN MSysAccounts G ON UG.GroupSID = G.SID
WHERE U.FGroup=0 AND G.FGroup<>0

Pieter

"Cicada" wrote in message
news:%23eo0JjUsGHA.4784@TK2MSFTNGP04.phx.gbl...
> As I state in Point 3, I can view (not hidden) MsysObjects table in both
> Access & my application (ADO-based),
> but I can just OPEN it in Access, but not in my application, and error
> message is "No authorization ro read". (but I have not set any
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=14007
> authorization level myself)
> (This application is not not programmed by me, but a standard database
> application very similar to Access).
>
> How to solve it 1st??
>
>
> "Pieter Wijnen"
>
> ¼¶¼g©ó¶l¥ó·s»D:u6itDMQsGHA.904@TK2MSFTNGP03.phx.gb l...
>> For all Tables
>> Create a new Query ( MSysObjects is hidden - leave it so - can be
>> changed through tools/options/show hidden objects)
>> Hit cancel for the table selection
>> View SQL
>> Write SELECT Name From MSYSOBJECTS A WHERE A.TYPE IN (1,6,4)
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=14007
>> This will give you all the tables (native, Linked, ODBC)
>>
>> For Queries (Views)
>> SELECT A.NameFROM MSYSOBJECTS A WHERE EXISTS ( SELECT 'X' FROM
>> MSysQueries B WHERE B.ObjectId =A.Id)
>>
>> To get all the users you'll need to use VB Code:
>>
>> Sub CreateUserTable()
>> Dim Ws As DAO.WorkSpace
>> Dim Db As DAO.Database
>> Dim Usr As DAO.User
>>
>> Set Ws = DAO.DbEngine.Workspaces(0)
>> Set Db = CurrentDb
>> Db.Execute "DROP Table USysUsers"
>> Db.Execute "CREATE TABLE USysUsers (UserName char(32))"
>> Db.Execute "CREATE UNIQUE INDEX PK_USysTable ON USysUsers (UserName) With
>> Primary"
>>
>> For Each Usr In Ws.Users
>> Db.Execute "INSERT INTO USysusers (UserName) VALUES ('" & Usr.Name &
>> "')"
>> Next ' Usr
>>
>> Set Db = Nothing
>> Set Ws = Nothing
>> End Sub
>>
>> now you can use (to show users - including "internal users" - Engine,
>> Creator)
>> SELECT UserName FROM USysUsers
>>
>> For MSSQL, Oracle(8i +) you can query:
>> INFORMATION_SCHEMA.TABLES etc
>>
>> Pieter
>>
>>
>> "Cicada" wrote in message
>> news:uEl%23O5PsGHA.4444@TK2MSFTNGP06.phx.gbl...
>>> Today I see a PostgreSQL SQL book and find some interesting commands
>>> below.
>>> Is there any similar SQL commands under ADO??
>>>
>>> 1. Meta-Command
>>> \d_\dt List All TAbles
>>> \dv List All View
>>> ...... List All Query (equal to View??)
>>> ...... List All Users
>>>
>>> 2. Frequency Statistic
>>> Select n_distinct, most_common_vals, most_common_freqs FROM .....
>>> ==> these 3 terms are system terms. Result is showing N-th data/value
>>> occuring with top frequency in a table's field.
>>>
>>> Besides, please help:
>>> 3. There is a System table in MS Access "MsysObjects".
>>> I can open it in MS Access easily, without any password needed, but
>>> not in my application.
>>> How to solve it?
>>>
>>> 4. I have searched through Google with keywords SQL ADO or SQL "OLE DB",
>>> I feel very strange that there is only a few data for the former, and
>>> None for the latter.
>>> Even though their ultimate data engine may be ODBC or Jet, their SQL
>>> language in User-Level should be defined by themselves.
>>> (Otherwise, there will not be so many SQL language around MS
>>> applications :> )
>>> Could you introduce me any tutorial and handbook web site for it??
>>>

>>
>>

>
>




--
----------------------------------------
I am using the free version of SPAMfighter for private users.
It has removed 4367 spam emails to date.
Paying users do not have this message in their emails.
Get the free SPAMfighter here: http://www.spamfighter.com/len


Reply With Quote
  #9 (permalink)  
Old 28-Jul-2006, 08:43 AM
Cicada's Avatar Cicada
Guest
 
Posts: n/a
   
   
Re: Interesting SQL commands

  Donate Today!  
Thanks very much for all of your great help!
I have learned a great lesson.

"Pieter Wijnen"

¼¶¼g©ó¶l¥ó·s»D:eGKKiyVsGHA.356@TK2MSFTNGP05.phx.gb l...
> Oh yeah I forgot about that, silly me
> you can query MSysAccounts in the system.mdw (workGroup file), to find the
> users (do it myself - I must admit)
>
> For Users:
> SELECT A.NAME FROM MSYSACCOUNTS A WHERE FGROUP = 0
>
> For Groups (Roles)
> SELECT A.NAME FROM MSYSACCOUNTS A WHERE FGROUP <>0
>
> For User/Roles (Membership):
> SELECT G.Name AS GroupName, U.Name AS UserName
> FROM (MSysAccounts U INNER JOIN MSysGroups UG ON U.SID = UG.UserSID) INNER
> JOIN MSysAccounts G ON UG.GroupSID = G.SID
> WHERE U.FGroup=0 AND G.FGroup<>0
>
> Pieter
>
> "Cicada" wrote in message
> news:%23eo0JjUsGHA.4784@TK2MSFTNGP04.phx.gbl...
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=14007
>> As I state in Point 3, I can view (not hidden) MsysObjects table in both
>> Access & my application (ADO-based),
>> but I can just OPEN it in Access, but not in my application, and error
>> message is "No authorization ro read". (but I have not set any
>> authorization level myself)
>> (This application is not not programmed by me, but a standard database
>> application very similar to Access).
>>
>> How to solve it 1st??
>>
>>
>> "Pieter Wijnen"
>>
>> ¼¶¼g©ó¶l¥ó·s»D:u6itDMQsGHA.904@TK2MSFTNGP03.phx.gb l...
>>> For all Tables
>>> Create a new Query ( MSysObjects is hidden - leave it so - can be
>>> changed through tools/options/show hidden objects)
>>> Hit cancel for the table selection
>>> View SQL
>>> Write SELECT Name From MSYSOBJECTS A WHERE A.TYPE IN (1,6,4)
>>> This will give you all the tables (native, Linked, ODBC)
>>>
>>> For Queries (Views)
>>> SELECT A.NameFROM MSYSOBJECTS A WHERE EXISTS ( SELECT 'X' FROM
>>> MSysQueries B WHERE B.ObjectId =A.Id)
>>>
>>> To get all the users you'll need to use VB Code:
>>>
>>> Sub CreateUserTable()
>>> Dim Ws As DAO.WorkSpace
>>> Dim Db As DAO.Database
>>> Dim Usr As DAO.User
>>>
>>> Set Ws = DAO.DbEngine.Workspaces(0)
>>> Set Db = CurrentDb
>>> Db.Execute "DROP Table USysUsers"
>>> Db.Execute "CREATE TABLE USysUsers (UserName char(32))"
>>> Db.Execute "CREATE UNIQUE INDEX PK_USysTable ON USysUsers (UserName)
>>> With Primary"
>>>
>>> For Each Usr In Ws.Users
>>> Db.Execute "INSERT INTO USysusers (UserName) VALUES ('" & Usr.Name &
>>> "')"
>>> Next ' Usr
>>>
>>> Set Db = Nothing
>>> Set Ws = Nothing
>>> End Sub
>>>
>>> now you can use (to show users - including "internal users" - Engine,
>>> Creator)
>>> SELECT UserName FROM USysUsers
>>>
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=14007
>>> For MSSQL, Oracle(8i +) you can query:
>>> INFORMATION_SCHEMA.TABLES etc
>>>
>>> Pieter
>>>
>>>
>>> "Cicada" wrote in message
>>> news:uEl%23O5PsGHA.4444@TK2MSFTNGP06.phx.gbl...
>>>> Today I see a PostgreSQL SQL book and find some interesting commands
>>>> below.
>>>> Is there any similar SQL commands under ADO??
>>>>
>>>> 1. Meta-Command
>>>> \d_\dt List All TAbles
>>>> \dv List All View
>>>> ...... List All Query (equal to View??)
>>>> ...... List All Users
>>>>
>>>> 2. Frequency Statistic
>>>> Select n_distinct, most_common_vals, most_common_freqs FROM .....
>>>> ==> these 3 terms are system terms. Result is showing N-th
>>>> data/value occuring with top frequency in a table's field.
>>>>
>>>> Besides, please help:
>>>> 3. There is a System table in MS Access "MsysObjects".
>>>> I can open it in MS Access easily, without any password needed, but
>>>> not in my application.
>>>> How to solve it?
>>>>
>>>> 4. I have searched through Google with keywords SQL ADO or SQL "OLE
>>>> DB", I feel very strange that there is only a few data for the former,
>>>> and None for the latter.
>>>> Even though their ultimate data engine may be ODBC or Jet, their SQL
>>>> language in User-Level should be defined by themselves.
>>>> (Otherwise, there will not be so many SQL language around MS
>>>> applications :> )
>>>> Could you introduce me any tutorial and handbook web site for it??
>>>>
>>>
>>>

>>
>>

>
>



Reply With Quote
   Click Here to Donate Now!

Support Us!
Become a Promoter!
Gurfateh ji, you can become a SPN Promoter by Donating as little as $10 each month. With limited resources & high operational costs, your donations make it possible for us to deliver a quality website and spread the teachings of the Sri Guru Granth Sahib Ji, to serve & uplift humanity. Every contribution counts. Donate Generously. Gurfateh!
ReplyPost New Topic In This Forum Stay Connected to Sikhism, Click Here to Register Now!

Bookmarks


(View-All Members who have read this thread : 0
There are no names to display.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Tools Search
Search:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On

» Gurbani Jukebox
Listen to Gurbani while surfing SPN!
» Active Discussions
sikhism Who is "Mohan"?
Today 08:46 AM
22 Replies, 335 Views
sikhism How important is Matha...
Today 08:12 AM
59 Replies, 1,038 Views
sikhism need urgent advice.......
Today 06:46 AM
6 Replies, 81 Views
sikhism ਨਾਮਾ
Today 06:37 AM
2 Replies, 53 Views
sikhism Sikh Diamonds Video...
Today 04:23 AM
6 Replies, 116 Views
sikhism Are Creator and Creation...
Today 01:30 AM
44 Replies, 2,837 Views
sikhism Herman Hesse,...
Today 00:54 AM
13 Replies, 229 Views
sikhism On a Scale of Most...
Yesterday 21:42 PM
30 Replies, 1,277 Views
sikhism I became victim by...
Yesterday 19:50 PM
0 Replies, 44 Views
sikhism Sikh Books downloads
Yesterday 15:39 PM
2 Replies, 66 Views
sikhism Salok Sheikh Farid ji...
Yesterday 09:35 AM
0 Replies, 47 Views
sikhism In Punjab, three farmers...
Yesterday 05:36 AM
0 Replies, 49 Views
sikhism Supernatural Sikhs, what...
Yesterday 03:45 AM
19 Replies, 414 Views
sikhism Sukhmani Sahib Astpadi...
26-May-2012 22:57 PM
0 Replies, 51 Views
Do You Think You Are...
26-May-2012 09:59 AM
94 Replies, 8,258 Views
» Books You Should Read...
Powered by vBadvanced CMPS v3.2.2

All times are GMT +6.5. The time now is 09:52 AM.
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.5.2 Copyright © 2004-12, All Rights Reserved. Sikh Philosophy Network


Page generated in 0.66081 seconds with 30 queries