469,950 Members | 1,456 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,950 developers. It's quick & easy.

How Can I List Tables in a DB?

I am using VS.NET 2003, VB.NET, ADO.NET and an Access 2000 database. I want
to display a list of all tables in an Access database. I want to put that
list of table names in a listbox so the user can select the table they want
to use. How can I do this?

--
------------------------------------
Wayne Wengert
wa***@wengert.org
Jul 19 '05 #1
11 4215
Check out http://www.aspfree.com/examples/544,1/examples.aspx
See if it helps
Regards
Sushila
..NET MVP

"Wayne Wengert" <wa***@wengert.org> wrote in message news:eM**************@TK2MSFTNGP09.phx.gbl...
I am using VS.NET 2003, VB.NET, ADO.NET and an Access 2000 database. I want
to display a list of all tables in an Access database. I want to put that
list of table names in a listbox so the user can select the table they want
to use. How can I do this?

--
------------------------------------
Wayne Wengert
wa***@wengert.org



Jul 19 '05 #2
Thanks for that pointer. I'll use that sample and see if I can adapt it to
my Windows Form app. I did not know about the "AllTables" parameter - that
is what I think I need.

Wayne

"Sonali.NET[MVP]" <xb********@hotmail.com> wrote in message
news:eK*************@TK2MSFTNGP10.phx.gbl...
Check out http://www.aspfree.com/examples/544,1/examples.aspx
See if it helps
Regards
Sushila
..NET MVP

"Wayne Wengert" <wa***@wengert.org> wrote in message
news:eM**************@TK2MSFTNGP09.phx.gbl...
I am using VS.NET 2003, VB.NET, ADO.NET and an Access 2000 database. I want to display a list of all tables in an Access database. I want to put that
list of table names in a listbox so the user can select the table they want to use. How can I do this?

--
------------------------------------
Wayne Wengert
wa***@wengert.org

Jul 19 '05 #3
Good idea. I'll play with that

Wayne

"Rick" <ri**@NOSPAM.computetosuit.com> wrote in message
news:Oe**************@tk2msftngp13.phx.gbl...
You might want to look at the MSysObjects table. It is an access table that lists all the objects for the database. I am pretty sure that the Type
column is 1 for table, and all the system tables are named "MSys*", so you
should be able to see all the tables that way.
"Wayne Wengert" <wa***@wengert.org> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Sonali;

It turns out that the syntax in that example does not work against an Access
DB. I am trying to find the right way to do this in Access without having to
go back to ADOX.

Wayne

"Sonali.NET[MVP]" <xb********@hotmail.com> wrote in message
news:eK*************@TK2MSFTNGP10.phx.gbl...
Check out http://www.aspfree.com/examples/544,1/examples.aspx
See if it helps
Regards
Sushila
.NET MVP

"Wayne Wengert" <wa***@wengert.org> wrote in message
news:eM**************@TK2MSFTNGP09.phx.gbl...
I am using VS.NET 2003, VB.NET, ADO.NET and an Access 2000 database. I

want
to display a list of all tables in an Access database. I want to put

that list of table names in a listbox so the user can select the table they

want
to use. How can I do this?

--
------------------------------------
Wayne Wengert
wa***@wengert.org



Jul 19 '05 #4
On Wed, 13 Aug 2003 12:06:14 -0600, "Wayne Wengert" <wa***@wengert.org> wrote:

I am using VS.NET 2003, VB.NET, ADO.NET and an Access 2000 database. I want
to display a list of all tables in an Access database. I want to put that
list of table names in a listbox so the user can select the table they want
to use. How can I do this?

Give the following a try:

Sub ListAccessTables()

Dim AccessConnection As System.Data.OleDb.OleDbConnection
Dim AccessDataTable As DataTable

Try

AccessConnection = New
System.Data.OleDb.OleDbConnection("Provider=Micros oft.Jet.OLEDB.4.0;" & _
"Data Source=E:\My Documents\db1.mdb")

AccessConnection.Open()

AccessDataTable =
AccessConnection.GetOleDbSchemaTable(System.Data.O leDb.OleDbSchemaGuid.Tables, New Object()
{Nothing, Nothing, Nothing, "TABLE"})

DataGrid1.DataSource = AccessDataTable

Catch ex As Exception
MessageBox.Show(ex.Message)
Finally
AccessConnection.Close()

End Try

End Sub
Paul ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)
Jul 19 '05 #5
Hi Wayne,

To resolve this issue, we can perform the following steps:

1. Open the access database.
2. Click Tools on the menu and choose Options.
3. On the view tab, check Hidden objects and System objects. Click OK.
4. Click Tools on the menu and move to Security, choose User and Group
Permissions.
5. Select your user name and "MsysObjects" object name. Check "read data".

Then, the MsysObjects table can be accessed from code.

Does this answer your question? Please let me know if you need more
information

Best regards,
Lewis

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
| From: "Wayne Wengert" <wa***@wengert.org>
| References: <eM**************@TK2MSFTNGP09.phx.gbl>
| Subject: Permission Problem
| Date: Thu, 14 Aug 2003 08:10:01 -0600
| Lines: 148
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <ev**************@tk2msftngp13.phx.gbl>
| Newsgroups: microsoft.public.dotnet.general
| NNTP-Posting-Host: skybeam143.skybeam.frii.net 216.17.229.143
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftn gp13.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:104555
| X-Tomcat-NG: microsoft.public.dotnet.general
|
| When I try to open the MSysObjects table I get the attached error. The
| Access DB is not password protected. How do I enable access to this table?
|
| Wayne
|
| "Wayne Wengert" <wa***@wengert.org> wrote in message
| news:eM**************@TK2MSFTNGP09.phx.gbl...
| > I am using VS.NET 2003, VB.NET, ADO.NET and an Access 2000 database. I
| want
| > to display a list of all tables in an Access database. I want to put
that
| > list of table names in a listbox so the user can select the table they
| want
| > to use. How can I do this?
| >
| > --
| > ------------------------------------
| > Wayne Wengert
| > wa***@wengert.org
| >
| >
|
|
|

Jul 19 '05 #6
The table is created "on-the-fly" from my code. The user enters some data in
a particular situation and my code creates a new table. How can I set the
user permissions from code.

Also, I added "User ID = Admin" to the connection string and that does not
help. I tried experimenting with a table my program had created earlier and
Access will not let me assign Read rights to any user I create. The
MSysObjects table shows the owner as "Engine"

Wayne

"Lewis Wang [MSFT]" <v-*****@online.microsoft.com> wrote in message
news:Ku*************@cpmsftngxa06.phx.gbl...
Hi Wayne,

To resolve this issue, we can perform the following steps:

1. Open the access database.
2. Click Tools on the menu and choose Options.
3. On the view tab, check Hidden objects and System objects. Click OK.
4. Click Tools on the menu and move to Security, choose User and Group
Permissions.
5. Select your user name and "MsysObjects" object name. Check "read data".

Then, the MsysObjects table can be accessed from code.

Does this answer your question? Please let me know if you need more
information

Best regards,
Lewis

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| From: "Wayne Wengert" <wa***@wengert.org>
| References: <eM**************@TK2MSFTNGP09.phx.gbl>
| Subject: Permission Problem
| Date: Thu, 14 Aug 2003 08:10:01 -0600
| Lines: 148
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <ev**************@tk2msftngp13.phx.gbl>
| Newsgroups: microsoft.public.dotnet.general
| NNTP-Posting-Host: skybeam143.skybeam.frii.net 216.17.229.143
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftn gp13.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:104555
| X-Tomcat-NG: microsoft.public.dotnet.general
|
| When I try to open the MSysObjects table I get the attached error. The
| Access DB is not password protected. How do I enable access to this table? |
| Wayne
|
| "Wayne Wengert" <wa***@wengert.org> wrote in message
| news:eM**************@TK2MSFTNGP09.phx.gbl...
| > I am using VS.NET 2003, VB.NET, ADO.NET and an Access 2000 database. I
| want
| > to display a list of all tables in an Access database. I want to put
that
| > list of table names in a listbox so the user can select the table they
| want
| > to use. How can I do this?
| >
| > --
| > ------------------------------------
| > Wayne Wengert
| > wa***@wengert.org
| >
| >
|
|
|

Jul 19 '05 #7
Hi Wayne,

You may use SQL DDL to change permissions on the tables. Please check
following articles for more information:

Advanced Microsoft Jet SQL for Access 2000
http://msdn.microsoft.com/library/en...l/acadvsql.asp

Intermediate Microsoft Jet SQL for Access 2000
http://msdn.microsoft.com/library/en...l/acintsql.asp

Hope this is helpful.

Best regards,
Lewis

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| From: "Wayne Wengert" <wa***@wengert.org>
| References: <eM**************@TK2MSFTNGP09.phx.gbl>
<ev**************@tk2msftngp13.phx.gbl>
<Ku*************@cpmsftngxa06.phx.gbl>
| Subject: Re: Permission Problem
| Date: Thu, 14 Aug 2003 12:38:40 -0600
| Lines: 80
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <O9**************@TK2MSFTNGP09.phx.gbl>
| Newsgroups: microsoft.public.dotnet.general
| NNTP-Posting-Host: skybeam143.skybeam.frii.net 216.17.229.143
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP09.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:104597
| X-Tomcat-NG: microsoft.public.dotnet.general
|
| The table is created "on-the-fly" from my code. The user enters some data
in
| a particular situation and my code creates a new table. How can I set the
| user permissions from code.
|
| Also, I added "User ID = Admin" to the connection string and that does not
| help. I tried experimenting with a table my program had created earlier
and
| Access will not let me assign Read rights to any user I create. The
| MSysObjects table shows the owner as "Engine"
|
| Wayne
|
| "Lewis Wang [MSFT]" <v-*****@online.microsoft.com> wrote in message
| news:Ku*************@cpmsftngxa06.phx.gbl...
| > Hi Wayne,
| >
| > To resolve this issue, we can perform the following steps:
| >
| > 1. Open the access database.
| > 2. Click Tools on the menu and choose Options.
| > 3. On the view tab, check Hidden objects and System objects. Click OK.
| > 4. Click Tools on the menu and move to Security, choose User and Group
| > Permissions.
| > 5. Select your user name and "MsysObjects" object name. Check "read
data".
| >
| > Then, the MsysObjects table can be accessed from code.
| >
| > Does this answer your question? Please let me know if you need more
| > information
| >
| > Best regards,
| > Lewis
| >
| > This posting is provided "AS IS" with no warranties, and confers no
| rights.
| >
| > --------------------
| > | From: "Wayne Wengert" <wa***@wengert.org>
| > | References: <eM**************@TK2MSFTNGP09.phx.gbl>
| > | Subject: Permission Problem
| > | Date: Thu, 14 Aug 2003 08:10:01 -0600
| > | Lines: 148
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | Message-ID: <ev**************@tk2msftngp13.phx.gbl>
| > | Newsgroups: microsoft.public.dotnet.general
| > | NNTP-Posting-Host: skybeam143.skybeam.frii.net 216.17.229.143
| > | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftn gp13.phx.gbl
| > | Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:104555
| > | X-Tomcat-NG: microsoft.public.dotnet.general
| > |
| > | When I try to open the MSysObjects table I get the attached error. The
| > | Access DB is not password protected. How do I enable access to this
| table?
| > |
| > | Wayne
| > |
| > | "Wayne Wengert" <wa***@wengert.org> wrote in message
| > | news:eM**************@TK2MSFTNGP09.phx.gbl...
| > | > I am using VS.NET 2003, VB.NET, ADO.NET and an Access 2000
database. I
| > | want
| > | > to display a list of all tables in an Access database. I want to put
| > that
| > | > list of table names in a listbox so the user can select the table
they
| > | want
| > | > to use. How can I do this?
| > | >
| > | > --
| > | > ------------------------------------
| > | > Wayne Wengert
| > | > wa***@wengert.org
| > | >
| > | >
| > |
| > |
| > |
| >
|
|
|

Jul 19 '05 #8
Hi Wayne,

You may set "impersonate" to "true" in web.config, then the ASP.NET
application will have the permission to access the Hidden Objects in Access.

The following is a code snippet for a demonstration.
<identity impersonate="true"></identity>

INFO: Implementing Impersonation in an ASP.NET Application.
<http://support.microsoft.com/?id=306158>

INFO: ASP.NET Security Overview
<http://support.microsoft.com/default.aspx?id=306590>

Does this answer your question? Please let me know if you need more
information.

Best regards,
Lewis

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
| From: "Wayne Wengert" <wa***@wengert.org>
| References: <eM**************@TK2MSFTNGP09.phx.gbl>
<ev**************@tk2msftngp13.phx.gbl>
<Ku*************@cpmsftngxa06.phx.gbl>
<O9**************@TK2MSFTNGP09.phx.gbl>
<nX**************@cpmsftngxa06.phx.gbl>
| Subject: Re: Permission Problem
| Date: Fri, 15 Aug 2003 17:20:13 -0600
| Lines: 437
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <us**************@TK2MSFTNGP10.phx.gbl>
| Newsgroups: microsoft.public.dotnet.general
| NNTP-Posting-Host: skybeam143.skybeam.frii.net 216.17.229.143
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP10.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:104734
| X-Tomcat-NG: microsoft.public.dotnet.general
|
| Lewis;
|
| I tried using the samples in the referenced articles using this code:
|
| strSQL = "GRANT SELECT ON TABLE MSysObjects TO Admin"
|
| myConn.Execute(strSQL)
|
|
| But I get the attached error. I am not sure how to resolve this? I did add
| the Imports for Interop thinking that might help - it didn't.
|
| Wayne
|
| "Lewis Wang [MSFT]" <v-*****@online.microsoft.com> wrote in message
| news:nX**************@cpmsftngxa06.phx.gbl...
| > Hi Wayne,
| >
| > You may use SQL DDL to change permissions on the tables. Please check
| > following articles for more information:
| >
| > Advanced Microsoft Jet SQL for Access 2000
| > http://msdn.microsoft.com/library/en...l/acadvsql.asp
| >
| > Intermediate Microsoft Jet SQL for Access 2000
| > http://msdn.microsoft.com/library/en...l/acintsql.asp
| >
| > Hope this is helpful.
| >
| > Best regards,
| > Lewis
| >
| > This posting is provided "AS IS" with no warranties, and confers no
| rights.
| > --------------------
| > | From: "Wayne Wengert" <wa***@wengert.org>
| > | References: <eM**************@TK2MSFTNGP09.phx.gbl>
| > <ev**************@tk2msftngp13.phx.gbl>
| > <Ku*************@cpmsftngxa06.phx.gbl>
| > | Subject: Re: Permission Problem
| > | Date: Thu, 14 Aug 2003 12:38:40 -0600
| > | Lines: 80
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | Message-ID: <O9**************@TK2MSFTNGP09.phx.gbl>
| > | Newsgroups: microsoft.public.dotnet.general
| > | NNTP-Posting-Host: skybeam143.skybeam.frii.net 216.17.229.143
| > | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP09.phx.gbl
| > | Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:104597
| > | X-Tomcat-NG: microsoft.public.dotnet.general
| > |
| > | The table is created "on-the-fly" from my code. The user enters some
| data
| > in
| > | a particular situation and my code creates a new table. How can I set
| the
| > | user permissions from code.
| > |
| > | Also, I added "User ID = Admin" to the connection string and that does
| not
| > | help. I tried experimenting with a table my program had created
earlier
| > and
| > | Access will not let me assign Read rights to any user I create. The
| > | MSysObjects table shows the owner as "Engine"
| > |
| > | Wayne
| > |
| > | "Lewis Wang [MSFT]" <v-*****@online.microsoft.com> wrote in message
| > | news:Ku*************@cpmsftngxa06.phx.gbl...
| > | > Hi Wayne,
| > | >
| > | > To resolve this issue, we can perform the following steps:
| > | >
| > | > 1. Open the access database.
| > | > 2. Click Tools on the menu and choose Options.
| > | > 3. On the view tab, check Hidden objects and System objects. Click
OK.
| > | > 4. Click Tools on the menu and move to Security, choose User and
Group
| > | > Permissions.
| > | > 5. Select your user name and "MsysObjects" object name. Check "read
| > data".
| > | >
| > | > Then, the MsysObjects table can be accessed from code.
| > | >
| > | > Does this answer your question? Please let me know if you need more
| > | > information
| > | >
| > | > Best regards,
| > | > Lewis
| > | >
| > | > This posting is provided "AS IS" with no warranties, and confers no
| > | rights.
| > | >
| > | > --------------------
| > | > | From: "Wayne Wengert" <wa***@wengert.org>
| > | > | References: <eM**************@TK2MSFTNGP09.phx.gbl>
| > | > | Subject: Permission Problem
| > | > | Date: Thu, 14 Aug 2003 08:10:01 -0600
| > | > | Lines: 148
| > | > | X-Priority: 3
| > | > | X-MSMail-Priority: Normal
| > | > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | > | Message-ID: <ev**************@tk2msftngp13.phx.gbl>
| > | > | Newsgroups: microsoft.public.dotnet.general
| > | > | NNTP-Posting-Host: skybeam143.skybeam.frii.net 216.17.229.143
| > | > | Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftn gp13.phx.gbl
| > | > | Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:104555
| > | > | X-Tomcat-NG: microsoft.public.dotnet.general
| > | > |
| > | > | When I try to open the MSysObjects table I get the attached error.
| The
| > | > | Access DB is not password protected. How do I enable access to
this
| > | table?
| > | > |
| > | > | Wayne
| > | > |
| > | > | "Wayne Wengert" <wa***@wengert.org> wrote in message
| > | > | news:eM**************@TK2MSFTNGP09.phx.gbl...
| > | > | > I am using VS.NET 2003, VB.NET, ADO.NET and an Access 2000
| > database. I
| > | > | want
| > | > | > to display a list of all tables in an Access database. I want to
| put
| > | > that
| > | > | > list of table names in a listbox so the user can select the
table
| > they
| > | > | want
| > | > | > to use. How can I do this?
| > | > | >
| > | > | > --
| > | > | > ------------------------------------
| > | > | > Wayne Wengert
| > | > | > wa***@wengert.org
| > | > | >
| > | > | >
| > | > |
| > | > |
| > | > |
| > | >
| > |
| > |
| > |
| >
|
|
|

Jul 19 '05 #9
Hi Wayne,

Sorry for my misunderstanding.

I am checking this issue, and will get back to you with my findings.

Best regards,
Lewis

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
| From: "Wayne Wengert" <wa***@wengert.org>
| References: <eM**************@TK2MSFTNGP09.phx.gbl>
<ev**************@tk2msftngp13.phx.gbl>
<Ku*************@cpmsftngxa06.phx.gbl>
<O9**************@TK2MSFTNGP09.phx.gbl>
<nX**************@cpmsftngxa06.phx.gbl>
<us**************@TK2MSFTNGP10.phx.gbl>
<HJ**************@cpmsftngxa06.phx.gbl>
| Subject: Re: Permission Problem
| Date: Mon, 18 Aug 2003 03:56:53 -0600
| Lines: 217
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <OR**************@tk2msftngp13.phx.gbl>
| Newsgroups: microsoft.public.dotnet.general
| NNTP-Posting-Host: skybeam143.skybeam.frii.net 216.17.229.143
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftn gp13.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:104867
| X-Tomcat-NG: microsoft.public.dotnet.general
|
| This is a Windows application - will that technique still work?
|
| Wayne
|
| "Lewis Wang [MSFT]" <v-*****@online.microsoft.com> wrote in message
| news:HJ**************@cpmsftngxa06.phx.gbl...
| > Hi Wayne,
| >
| > You may set "impersonate" to "true" in web.config, then the ASP.NET
| > application will have the permission to access the Hidden Objects in
| Access.
| >
| > The following is a code snippet for a demonstration.
| > <identity impersonate="true"></identity>
| >
| > INFO: Implementing Impersonation in an ASP.NET Application.
| > <http://support.microsoft.com/?id=306158>
| >
| > INFO: ASP.NET Security Overview
| > <http://support.microsoft.com/default.aspx?id=306590>
| >
| > Does this answer your question? Please let me know if you need more
| > information.
| >
| > Best regards,
| > Lewis
| >
| > This posting is provided "AS IS" with no warranties, and confers no
| rights.
| >
| > --------------------
| > | From: "Wayne Wengert" <wa***@wengert.org>
| > | References: <eM**************@TK2MSFTNGP09.phx.gbl>
| > <ev**************@tk2msftngp13.phx.gbl>
| > <Ku*************@cpmsftngxa06.phx.gbl>
| > <O9**************@TK2MSFTNGP09.phx.gbl>
| > <nX**************@cpmsftngxa06.phx.gbl>
| > | Subject: Re: Permission Problem
| > | Date: Fri, 15 Aug 2003 17:20:13 -0600
| > | Lines: 437
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | Message-ID: <us**************@TK2MSFTNGP10.phx.gbl>
| > | Newsgroups: microsoft.public.dotnet.general
| > | NNTP-Posting-Host: skybeam143.skybeam.frii.net 216.17.229.143
| > | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP10.phx.gbl
| > | Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:104734
| > | X-Tomcat-NG: microsoft.public.dotnet.general
| > |
| > | Lewis;
| > |
| > | I tried using the samples in the referenced articles using this code:
| > |
| > | strSQL = "GRANT SELECT ON TABLE MSysObjects TO Admin"
| > |
| > | myConn.Execute(strSQL)
| > |
| > |
| > | But I get the attached error. I am not sure how to resolve this? I did
| add
| > | the Imports for Interop thinking that might help - it didn't.
| > |
| > | Wayne
| > |
| > | "Lewis Wang [MSFT]" <v-*****@online.microsoft.com> wrote in message
| > | news:nX**************@cpmsftngxa06.phx.gbl...
| > | > Hi Wayne,
| > | >
| > | > You may use SQL DDL to change permissions on the tables. Please
check
| > | > following articles for more information:
| > | >
| > | > Advanced Microsoft Jet SQL for Access 2000
| > | > http://msdn.microsoft.com/library/en...l/acadvsql.asp
| > | >
| > | > Intermediate Microsoft Jet SQL for Access 2000
| > | > http://msdn.microsoft.com/library/en...l/acintsql.asp
| > | >
| > | > Hope this is helpful.
| > | >
| > | > Best regards,
| > | > Lewis
| > | >
| > | > This posting is provided "AS IS" with no warranties, and confers no
| > | rights.
| > | > --------------------
| > | > | From: "Wayne Wengert" <wa***@wengert.org>
| > | > | References: <eM**************@TK2MSFTNGP09.phx.gbl>
| > | > <ev**************@tk2msftngp13.phx.gbl>
| > | > <Ku*************@cpmsftngxa06.phx.gbl>
| > | > | Subject: Re: Permission Problem
| > | > | Date: Thu, 14 Aug 2003 12:38:40 -0600
| > | > | Lines: 80
| > | > | X-Priority: 3
| > | > | X-MSMail-Priority: Normal
| > | > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | > | Message-ID: <O9**************@TK2MSFTNGP09.phx.gbl>
| > | > | Newsgroups: microsoft.public.dotnet.general
| > | > | NNTP-Posting-Host: skybeam143.skybeam.frii.net 216.17.229.143
| > | > | Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP09.phx.gbl
| > | > | Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:104597
| > | > | X-Tomcat-NG: microsoft.public.dotnet.general
| > | > |
| > | > | The table is created "on-the-fly" from my code. The user enters
some
| > | data
| > | > in
| > | > | a particular situation and my code creates a new table. How can I
| set
| > | the
| > | > | user permissions from code.
| > | > |
| > | > | Also, I added "User ID = Admin" to the connection string and that
| does
| > | not
| > | > | help. I tried experimenting with a table my program had created
| > earlier
| > | > and
| > | > | Access will not let me assign Read rights to any user I create.
The
| > | > | MSysObjects table shows the owner as "Engine"
| > | > |
| > | > | Wayne
| > | > |
| > | > | "Lewis Wang [MSFT]" <v-*****@online.microsoft.com> wrote in
message
| > | > | news:Ku*************@cpmsftngxa06.phx.gbl...
| > | > | > Hi Wayne,
| > | > | >
| > | > | > To resolve this issue, we can perform the following steps:
| > | > | >
| > | > | > 1. Open the access database.
| > | > | > 2. Click Tools on the menu and choose Options.
| > | > | > 3. On the view tab, check Hidden objects and System objects.
Click
| > OK.
| > | > | > 4. Click Tools on the menu and move to Security, choose User and
| > Group
| > | > | > Permissions.
| > | > | > 5. Select your user name and "MsysObjects" object name. Check
| "read
| > | > data".
| > | > | >
| > | > | > Then, the MsysObjects table can be accessed from code.
| > | > | >
| > | > | > Does this answer your question? Please let me know if you need
| more
| > | > | > information
| > | > | >
| > | > | > Best regards,
| > | > | > Lewis
| > | > | >
| > | > | > This posting is provided "AS IS" with no warranties, and confers
| no
| > | > | rights.
| > | > | >
| > | > | > --------------------
| > | > | > | From: "Wayne Wengert" <wa***@wengert.org>
| > | > | > | References: <eM**************@TK2MSFTNGP09.phx.gbl>
| > | > | > | Subject: Permission Problem
| > | > | > | Date: Thu, 14 Aug 2003 08:10:01 -0600
| > | > | > | Lines: 148
| > | > | > | X-Priority: 3
| > | > | > | X-MSMail-Priority: Normal
| > | > | > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | > | > | Message-ID: <ev**************@tk2msftngp13.phx.gbl>
| > | > | > | Newsgroups: microsoft.public.dotnet.general
| > | > | > | NNTP-Posting-Host: skybeam143.skybeam.frii.net 216.17.229.143
| > | > | > | Path:
| > cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftn gp13.phx.gbl
| > | > | > | Xref: cpmsftngxa06.phx.gbl
| microsoft.public.dotnet.general:104555
| > | > | > | X-Tomcat-NG: microsoft.public.dotnet.general
| > | > | > |
| > | > | > | When I try to open the MSysObjects table I get the attached
| error.
| > | The
| > | > | > | Access DB is not password protected. How do I enable access to
| > this
| > | > | table?
| > | > | > |
| > | > | > | Wayne
| > | > | > |
| > | > | > | "Wayne Wengert" <wa***@wengert.org> wrote in message
| > | > | > | news:eM**************@TK2MSFTNGP09.phx.gbl...
| > | > | > | > I am using VS.NET 2003, VB.NET, ADO.NET and an Access 2000
| > | > database. I
| > | > | > | want
| > | > | > | > to display a list of all tables in an Access database. I
want
| to
| > | put
| > | > | > that
| > | > | > | > list of table names in a listbox so the user can select the
| > table
| > | > they
| > | > | > | want
| > | > | > | > to use. How can I do this?
| > | > | > | >
| > | > | > | > --
| > | > | > | > ------------------------------------
| > | > | > | > Wayne Wengert
| > | > | > | > wa***@wengert.org
| > | > | > | >
| > | > | > | >
| > | > | > |
| > | > | > |
| > | > | > |
| > | > | >
| > | > |
| > | > |
| > | > |
| > | >
| > |
| > |
| > |
| >
|
|
|

Jul 19 '05 #10
Hi Wayne,

To resolve this problem, you may perform the following steps.

1. Create "Secured.mdw" using "Wrkgadm.exe" for the access database. This
"Wrkgadm.exe" can be found at the following location: "C:\Program
Files\Microsoft Office\Office\1033". The following KB article described how
to create "Secured.mdw" using "Wrkgadm.exe".

305541 ACC2000: Understanding the Role of Workgroup Information Files in
Access
http://support.microsoft.com/?id=305541
2. Use MSDataShape Provider to grant privilege to Admin. The following is a
code snippet for demonstration, you can modify it to meet your reference.

oleDbConnection1=new OleDbConnection(@"Provider=MSDataShape;Data
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=db1.mdb;User
Id=admin;Password=;Jet OLEDB:System Database=Secured.mdw");
oleDbConnection1.Open ();
oleDbCommand1=new OleDbCommand ("GRANT SELECT ON TABLE MSysObjects TO
Admin",oleDbConnection1);
oleDbCommand1.ExecuteNonQuery();
oleDbDataAdapter1=new OleDbDataAdapter("SELECT * FROM
MSysObjects",oleDbConnection1);
DataSet ds=new DataSet();
oleDbDataAdapter1.Fill(ds);

For more information, you may check the KB article:

247662 HOWTO: Access a Secured Jet Database Through the MSDataShape Provider
http://support.microsoft.com/?id=247662

Best regards,
Lewis

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
| From: "Wayne Wengert" <wa***@wengert.org>
| References: <eM**************@TK2MSFTNGP09.phx.gbl>
<ev**************@tk2msftngp13.phx.gbl>
<Ku*************@cpmsftngxa06.phx.gbl>
<O9**************@TK2MSFTNGP09.phx.gbl>
<nX**************@cpmsftngxa06.phx.gbl>
<us**************@TK2MSFTNGP10.phx.gbl>
<HJ**************@cpmsftngxa06.phx.gbl>
| Subject: Re: Permission Problem
| Date: Mon, 18 Aug 2003 03:56:53 -0600
| Lines: 217
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <OR**************@tk2msftngp13.phx.gbl>
| Newsgroups: microsoft.public.dotnet.general
| NNTP-Posting-Host: skybeam143.skybeam.frii.net 216.17.229.143
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftn gp13.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:104867
| X-Tomcat-NG: microsoft.public.dotnet.general
|
| This is a Windows application - will that technique still work?
|
| Wayne
|
| "Lewis Wang [MSFT]" <v-*****@online.microsoft.com> wrote in message
| news:HJ**************@cpmsftngxa06.phx.gbl...
| > Hi Wayne,
| >
| > You may set "impersonate" to "true" in web.config, then the ASP.NET
| > application will have the permission to access the Hidden Objects in
| Access.
| >
| > The following is a code snippet for a demonstration.
| > <identity impersonate="true"></identity>
| >
| > INFO: Implementing Impersonation in an ASP.NET Application.
| > <http://support.microsoft.com/?id=306158>
| >
| > INFO: ASP.NET Security Overview
| > <http://support.microsoft.com/default.aspx?id=306590>
| >
| > Does this answer your question? Please let me know if you need more
| > information.
| >
| > Best regards,
| > Lewis
| >
| > This posting is provided "AS IS" with no warranties, and confers no
| rights.
| >
| > --------------------
| > | From: "Wayne Wengert" <wa***@wengert.org>
| > | References: <eM**************@TK2MSFTNGP09.phx.gbl>
| > <ev**************@tk2msftngp13.phx.gbl>
| > <Ku*************@cpmsftngxa06.phx.gbl>
| > <O9**************@TK2MSFTNGP09.phx.gbl>
| > <nX**************@cpmsftngxa06.phx.gbl>
| > | Subject: Re: Permission Problem
| > | Date: Fri, 15 Aug 2003 17:20:13 -0600
| > | Lines: 437
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | Message-ID: <us**************@TK2MSFTNGP10.phx.gbl>
| > | Newsgroups: microsoft.public.dotnet.general
| > | NNTP-Posting-Host: skybeam143.skybeam.frii.net 216.17.229.143
| > | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP10.phx.gbl
| > | Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:104734
| > | X-Tomcat-NG: microsoft.public.dotnet.general
| > |
| > | Lewis;
| > |
| > | I tried using the samples in the referenced articles using this code:
| > |
| > | strSQL = "GRANT SELECT ON TABLE MSysObjects TO Admin"
| > |
| > | myConn.Execute(strSQL)
| > |
| > |
| > | But I get the attached error. I am not sure how to resolve this? I did
| add
| > | the Imports for Interop thinking that might help - it didn't.
| > |
| > | Wayne
| > |
| > | "Lewis Wang [MSFT]" <v-*****@online.microsoft.com> wrote in message
| > | news:nX**************@cpmsftngxa06.phx.gbl...
| > | > Hi Wayne,
| > | >
| > | > You may use SQL DDL to change permissions on the tables. Please
check
| > | > following articles for more information:
| > | >
| > | > Advanced Microsoft Jet SQL for Access 2000
| > | > http://msdn.microsoft.com/library/en...l/acadvsql.asp
| > | >
| > | > Intermediate Microsoft Jet SQL for Access 2000
| > | > http://msdn.microsoft.com/library/en...l/acintsql.asp
| > | >
| > | > Hope this is helpful.
| > | >
| > | > Best regards,
| > | > Lewis
| > | >
| > | > This posting is provided "AS IS" with no warranties, and confers no
| > | rights.
| > | > --------------------
| > | > | From: "Wayne Wengert" <wa***@wengert.org>
| > | > | References: <eM**************@TK2MSFTNGP09.phx.gbl>
| > | > <ev**************@tk2msftngp13.phx.gbl>
| > | > <Ku*************@cpmsftngxa06.phx.gbl>
| > | > | Subject: Re: Permission Problem
| > | > | Date: Thu, 14 Aug 2003 12:38:40 -0600
| > | > | Lines: 80
| > | > | X-Priority: 3
| > | > | X-MSMail-Priority: Normal
| > | > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | > | Message-ID: <O9**************@TK2MSFTNGP09.phx.gbl>
| > | > | Newsgroups: microsoft.public.dotnet.general
| > | > | NNTP-Posting-Host: skybeam143.skybeam.frii.net 216.17.229.143
| > | > | Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP09.phx.gbl
| > | > | Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:104597
| > | > | X-Tomcat-NG: microsoft.public.dotnet.general
| > | > |
| > | > | The table is created "on-the-fly" from my code. The user enters
some
| > | data
| > | > in
| > | > | a particular situation and my code creates a new table. How can I
| set
| > | the
| > | > | user permissions from code.
| > | > |
| > | > | Also, I added "User ID = Admin" to the connection string and that
| does
| > | not
| > | > | help. I tried experimenting with a table my program had created
| > earlier
| > | > and
| > | > | Access will not let me assign Read rights to any user I create.
The
| > | > | MSysObjects table shows the owner as "Engine"
| > | > |
| > | > | Wayne
| > | > |
| > | > | "Lewis Wang [MSFT]" <v-*****@online.microsoft.com> wrote in
message
| > | > | news:Ku*************@cpmsftngxa06.phx.gbl...
| > | > | > Hi Wayne,
| > | > | >
| > | > | > To resolve this issue, we can perform the following steps:
| > | > | >
| > | > | > 1. Open the access database.
| > | > | > 2. Click Tools on the menu and choose Options.
| > | > | > 3. On the view tab, check Hidden objects and System objects.
Click
| > OK.
| > | > | > 4. Click Tools on the menu and move to Security, choose User and
| > Group
| > | > | > Permissions.
| > | > | > 5. Select your user name and "MsysObjects" object name. Check
| "read
| > | > data".
| > | > | >
| > | > | > Then, the MsysObjects table can be accessed from code.
| > | > | >
| > | > | > Does this answer your question? Please let me know if you need
| more
| > | > | > information
| > | > | >
| > | > | > Best regards,
| > | > | > Lewis
| > | > | >
| > | > | > This posting is provided "AS IS" with no warranties, and confers
| no
| > | > | rights.
| > | > | >
| > | > | > --------------------
| > | > | > | From: "Wayne Wengert" <wa***@wengert.org>
| > | > | > | References: <eM**************@TK2MSFTNGP09.phx.gbl>
| > | > | > | Subject: Permission Problem
| > | > | > | Date: Thu, 14 Aug 2003 08:10:01 -0600
| > | > | > | Lines: 148
| > | > | > | X-Priority: 3
| > | > | > | X-MSMail-Priority: Normal
| > | > | > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | > | > | Message-ID: <ev**************@tk2msftngp13.phx.gbl>
| > | > | > | Newsgroups: microsoft.public.dotnet.general
| > | > | > | NNTP-Posting-Host: skybeam143.skybeam.frii.net 216.17.229.143
| > | > | > | Path:
| > cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftn gp13.phx.gbl
| > | > | > | Xref: cpmsftngxa06.phx.gbl
| microsoft.public.dotnet.general:104555
| > | > | > | X-Tomcat-NG: microsoft.public.dotnet.general
| > | > | > |
| > | > | > | When I try to open the MSysObjects table I get the attached
| error.
| > | The
| > | > | > | Access DB is not password protected. How do I enable access to
| > this
| > | > | table?
| > | > | > |
| > | > | > | Wayne
| > | > | > |
| > | > | > | "Wayne Wengert" <wa***@wengert.org> wrote in message
| > | > | > | news:eM**************@TK2MSFTNGP09.phx.gbl...
| > | > | > | > I am using VS.NET 2003, VB.NET, ADO.NET and an Access 2000
| > | > database. I
| > | > | > | want
| > | > | > | > to display a list of all tables in an Access database. I
want
| to
| > | put
| > | > | > that
| > | > | > | > list of table names in a listbox so the user can select the
| > table
| > | > they
| > | > | > | want
| > | > | > | > to use. How can I do this?
| > | > | > | >
| > | > | > | > --
| > | > | > | > ------------------------------------
| > | > | > | > Wayne Wengert
| > | > | > | > wa***@wengert.org
| > | > | > | >
| > | > | > | >
| > | > | > |
| > | > | > |
| > | > | > |
| > | > | >
| > | > |
| > | > |
| > | > |
| > | >
| > |
| > |
| > |
| >
|
|
|

Jul 19 '05 #11
Thanks Lewis - I'll pursue those articles.

Wayne

"Lewis Wang [MSFT]" <v-*****@online.microsoft.com> wrote in message
news:Ld**************@cpmsftngxa06.phx.gbl...
Hi Wayne,

To resolve this problem, you may perform the following steps.

1. Create "Secured.mdw" using "Wrkgadm.exe" for the access database. This
"Wrkgadm.exe" can be found at the following location: "C:\Program
Files\Microsoft Office\Office\1033". The following KB article described how to create "Secured.mdw" using "Wrkgadm.exe".

305541 ACC2000: Understanding the Role of Workgroup Information Files in
Access
http://support.microsoft.com/?id=305541
2. Use MSDataShape Provider to grant privilege to Admin. The following is a code snippet for demonstration, you can modify it to meet your reference.

oleDbConnection1=new OleDbConnection(@"Provider=MSDataShape;Data
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=db1.mdb;User
Id=admin;Password=;Jet OLEDB:System Database=Secured.mdw");
oleDbConnection1.Open ();
oleDbCommand1=new OleDbCommand ("GRANT SELECT ON TABLE MSysObjects TO
Admin",oleDbConnection1);
oleDbCommand1.ExecuteNonQuery();
oleDbDataAdapter1=new OleDbDataAdapter("SELECT * FROM
MSysObjects",oleDbConnection1);
DataSet ds=new DataSet();
oleDbDataAdapter1.Fill(ds);

For more information, you may check the KB article:

247662 HOWTO: Access a Secured Jet Database Through the MSDataShape Provider http://support.microsoft.com/?id=247662

Best regards,
Lewis

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| From: "Wayne Wengert" <wa***@wengert.org>
| References: <eM**************@TK2MSFTNGP09.phx.gbl>
<ev**************@tk2msftngp13.phx.gbl>
<Ku*************@cpmsftngxa06.phx.gbl>
<O9**************@TK2MSFTNGP09.phx.gbl>
<nX**************@cpmsftngxa06.phx.gbl>
<us**************@TK2MSFTNGP10.phx.gbl>
<HJ**************@cpmsftngxa06.phx.gbl>
| Subject: Re: Permission Problem
| Date: Mon, 18 Aug 2003 03:56:53 -0600
| Lines: 217
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <OR**************@tk2msftngp13.phx.gbl>
| Newsgroups: microsoft.public.dotnet.general
| NNTP-Posting-Host: skybeam143.skybeam.frii.net 216.17.229.143
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftn gp13.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:104867
| X-Tomcat-NG: microsoft.public.dotnet.general
|
| This is a Windows application - will that technique still work?
|
| Wayne
|
| "Lewis Wang [MSFT]" <v-*****@online.microsoft.com> wrote in message
| news:HJ**************@cpmsftngxa06.phx.gbl...
| > Hi Wayne,
| >
| > You may set "impersonate" to "true" in web.config, then the ASP.NET
| > application will have the permission to access the Hidden Objects in
| Access.
| >
| > The following is a code snippet for a demonstration.
| > <identity impersonate="true"></identity>
| >
| > INFO: Implementing Impersonation in an ASP.NET Application.
| > <http://support.microsoft.com/?id=306158>
| >
| > INFO: ASP.NET Security Overview
| > <http://support.microsoft.com/default.aspx?id=306590>
| >
| > Does this answer your question? Please let me know if you need more
| > information.
| >
| > Best regards,
| > Lewis
| >
| > This posting is provided "AS IS" with no warranties, and confers no
| rights.
| >
| > --------------------
| > | From: "Wayne Wengert" <wa***@wengert.org>
| > | References: <eM**************@TK2MSFTNGP09.phx.gbl>
| > <ev**************@tk2msftngp13.phx.gbl>
| > <Ku*************@cpmsftngxa06.phx.gbl>
| > <O9**************@TK2MSFTNGP09.phx.gbl>
| > <nX**************@cpmsftngxa06.phx.gbl>
| > | Subject: Re: Permission Problem
| > | Date: Fri, 15 Aug 2003 17:20:13 -0600
| > | Lines: 437
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | Message-ID: <us**************@TK2MSFTNGP10.phx.gbl>
| > | Newsgroups: microsoft.public.dotnet.general
| > | NNTP-Posting-Host: skybeam143.skybeam.frii.net 216.17.229.143
| > | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP10.phx.gbl
| > | Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:104734
| > | X-Tomcat-NG: microsoft.public.dotnet.general
| > |
| > | Lewis;
| > |
| > | I tried using the samples in the referenced articles using this code: | > |
| > | strSQL = "GRANT SELECT ON TABLE MSysObjects TO Admin"
| > |
| > | myConn.Execute(strSQL)
| > |
| > |
| > | But I get the attached error. I am not sure how to resolve this? I did | add
| > | the Imports for Interop thinking that might help - it didn't.
| > |
| > | Wayne
| > |
| > | "Lewis Wang [MSFT]" <v-*****@online.microsoft.com> wrote in message
| > | news:nX**************@cpmsftngxa06.phx.gbl...
| > | > Hi Wayne,
| > | >
| > | > You may use SQL DDL to change permissions on the tables. Please
check
| > | > following articles for more information:
| > | >
| > | > Advanced Microsoft Jet SQL for Access 2000
| > | > http://msdn.microsoft.com/library/en...l/acadvsql.asp
| > | >
| > | > Intermediate Microsoft Jet SQL for Access 2000
| > | > http://msdn.microsoft.com/library/en...l/acintsql.asp
| > | >
| > | > Hope this is helpful.
| > | >
| > | > Best regards,
| > | > Lewis
| > | >
| > | > This posting is provided "AS IS" with no warranties, and confers no | > | rights.
| > | > --------------------
| > | > | From: "Wayne Wengert" <wa***@wengert.org>
| > | > | References: <eM**************@TK2MSFTNGP09.phx.gbl>
| > | > <ev**************@tk2msftngp13.phx.gbl>
| > | > <Ku*************@cpmsftngxa06.phx.gbl>
| > | > | Subject: Re: Permission Problem
| > | > | Date: Thu, 14 Aug 2003 12:38:40 -0600
| > | > | Lines: 80
| > | > | X-Priority: 3
| > | > | X-MSMail-Priority: Normal
| > | > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | > | Message-ID: <O9**************@TK2MSFTNGP09.phx.gbl>
| > | > | Newsgroups: microsoft.public.dotnet.general
| > | > | NNTP-Posting-Host: skybeam143.skybeam.frii.net 216.17.229.143
| > | > | Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP09.phx.gbl
| > | > | Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:104597 | > | > | X-Tomcat-NG: microsoft.public.dotnet.general
| > | > |
| > | > | The table is created "on-the-fly" from my code. The user enters
some
| > | data
| > | > in
| > | > | a particular situation and my code creates a new table. How can I | set
| > | the
| > | > | user permissions from code.
| > | > |
| > | > | Also, I added "User ID = Admin" to the connection string and that | does
| > | not
| > | > | help. I tried experimenting with a table my program had created
| > earlier
| > | > and
| > | > | Access will not let me assign Read rights to any user I create.
The
| > | > | MSysObjects table shows the owner as "Engine"
| > | > |
| > | > | Wayne
| > | > |
| > | > | "Lewis Wang [MSFT]" <v-*****@online.microsoft.com> wrote in
message
| > | > | news:Ku*************@cpmsftngxa06.phx.gbl...
| > | > | > Hi Wayne,
| > | > | >
| > | > | > To resolve this issue, we can perform the following steps:
| > | > | >
| > | > | > 1. Open the access database.
| > | > | > 2. Click Tools on the menu and choose Options.
| > | > | > 3. On the view tab, check Hidden objects and System objects.
Click
| > OK.
| > | > | > 4. Click Tools on the menu and move to Security, choose User and | > Group
| > | > | > Permissions.
| > | > | > 5. Select your user name and "MsysObjects" object name. Check
| "read
| > | > data".
| > | > | >
| > | > | > Then, the MsysObjects table can be accessed from code.
| > | > | >
| > | > | > Does this answer your question? Please let me know if you need
| more
| > | > | > information
| > | > | >
| > | > | > Best regards,
| > | > | > Lewis
| > | > | >
| > | > | > This posting is provided "AS IS" with no warranties, and confers | no
| > | > | rights.
| > | > | >
| > | > | > --------------------
| > | > | > | From: "Wayne Wengert" <wa***@wengert.org>
| > | > | > | References: <eM**************@TK2MSFTNGP09.phx.gbl>
| > | > | > | Subject: Permission Problem
| > | > | > | Date: Thu, 14 Aug 2003 08:10:01 -0600
| > | > | > | Lines: 148
| > | > | > | X-Priority: 3
| > | > | > | X-MSMail-Priority: Normal
| > | > | > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | > | > | Message-ID: <ev**************@tk2msftngp13.phx.gbl>
| > | > | > | Newsgroups: microsoft.public.dotnet.general
| > | > | > | NNTP-Posting-Host: skybeam143.skybeam.frii.net 216.17.229.143 | > | > | > | Path:
| > cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftn gp13.phx.gbl
| > | > | > | Xref: cpmsftngxa06.phx.gbl
| microsoft.public.dotnet.general:104555
| > | > | > | X-Tomcat-NG: microsoft.public.dotnet.general
| > | > | > |
| > | > | > | When I try to open the MSysObjects table I get the attached
| error.
| > | The
| > | > | > | Access DB is not password protected. How do I enable access to | > this
| > | > | table?
| > | > | > |
| > | > | > | Wayne
| > | > | > |
| > | > | > | "Wayne Wengert" <wa***@wengert.org> wrote in message
| > | > | > | news:eM**************@TK2MSFTNGP09.phx.gbl...
| > | > | > | > I am using VS.NET 2003, VB.NET, ADO.NET and an Access 2000
| > | > database. I
| > | > | > | want
| > | > | > | > to display a list of all tables in an Access database. I
want
| to
| > | put
| > | > | > that
| > | > | > | > list of table names in a listbox so the user can select the | > table
| > | > they
| > | > | > | want
| > | > | > | > to use. How can I do this?
| > | > | > | >
| > | > | > | > --
| > | > | > | > ------------------------------------
| > | > | > | > Wayne Wengert
| > | > | > | > wa***@wengert.org
| > | > | > | >
| > | > | > | >
| > | > | > |
| > | > | > |
| > | > | > |
| > | > | >
| > | > |
| > | > |
| > | > |
| > | >
| > |
| > |
| > |
| >
|
|
|

Jul 19 '05 #12

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by picander77 | last post: by
2 posts views Thread by Brian Henry | last post: by
5 posts views Thread by Javed | last post: by
5 posts views Thread by Lee Brotzman | last post: by
7 posts views Thread by =?Utf-8?B?UmVraGE=?= | last post: by
1 post views Thread by raam | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.