473,320 Members | 2,202 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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 4386
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Not Me | last post by:
Hi, I'm sure this is a common problem.. to create a single field from a whole column, where each row would be separated by a comma. I can do this for a specified table, and column.. and I've...
0
by: picander77 | last post by:
Hello! I need to perform the following operation on an XML document: I have a first element containing a list of team (<Teams>). A name is assigned to all teams, as well as a list of their...
8
by: tom | last post by:
I am new to SQL administration. >From a list of IDs that are the primary key in one table (i.e. Customer Table), I want to make changes in tables that use those IDs as a foreign key. ...
2
by: Brian Henry | last post by:
I am working on a internal intranet site, and i need to make a permissions page, all the account authorization is done through AD to let them see the intranet site.. now, the permissions page i...
5
by: Javed | last post by:
Hi, is there a way to get a list of tables in MDB file? Ideally I want to write an SQL similar to 'select * from tab' of oracle.
5
by: Lee Brotzman | last post by:
Hi, I have a sequence of data tables in an ordered list, like this: <ol> <li><table></table></li> <li><table></table></li> </ol> However it renders on the page with the list item number...
7
by: =?Utf-8?B?UmVraGE=?= | last post by:
Hi, I am trying to change the font color for the items in a dropdownlist control at run time using ASP.NET 2.0. DropDownList1.Items.Attributes.Add("style", "color:red"); But when I run the...
3
by: Robertf987 | last post by:
Well, I think I've described what I want to do in the title here. In the database, I have two main tables that contain the main data for the database. One for group expenditures, another for...
2
by: Lysander | last post by:
I have not seen this feature documented before, so I thought I would share it with you, as I will be using it in a later article. For a combo or list box, the source data is normally a...
1
by: raam | last post by:
hi I have a list box with some country names from database. when i click search button the "country" list selecteditem should be selected. but it is not. here is my code where iam using a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.