Board index » delphi » Stop user from entering table design mode

Stop user from entering table design mode

I have two applications which are reading/writing to an Access database.
However, whenever a user opens up the Access database and opens a table in
"design mode", my applications crash since they can't write to the database
whilst the user is in design mode.

1. I can fix my program so that it detects this situation and queues the
changes until the user is no longer in design mode, however the user
shouldn't be in design mode in the first place.

2. I can't use exclusive access since I need two programs to access the
database.

3. I don't want to use a database password to prevent users from changing
the design since the users should be able to change the design when the
programs are not running, but not while the programs are running.

--
Chuck

 

Re:Stop user from entering table design mode


You could open all tables for reading in your app. Not very elegant,
but effective. It won't prevent users opening the tables in design
mode, but will prevent them from making modifications to the design.
You can check this by opening the same database in different instances
of MS Access. Opening a table in the first and trying to design it in
the second. You will get a warning that you can't make any
modifications to the design.

Marjan
____________________________
Marjan Venema - BJM Software
http://www.bjmsoftware.com
http://www.bjmsoftware.nl

Re:Stop user from entering table design mode


I see what you mean, this behaviour should be sufficient. How do I open the
table programmatically (I only know how to do queries and commands)?

--
Chuck

Quote
"Marjan Venema" <i...@bjmsoftware.OhNoNotThis.com> wrote in message

news:i8l79v49q3ft7hii04d38ekek4endd4ea6@4ax.com...
Quote

> You could open all tables for reading in your app. Not very elegant,
> but effective. It won't prevent users opening the tables in design
> mode, but will prevent them from making modifications to the design.
> You can check this by opening the same database in different instances
> of MS Access. Opening a table in the first and trying to design it in
> the second. You will get a warning that you can't make any
> modifications to the design.

> Marjan
> ____________________________
> Marjan Venema - BJM Software
> http://www.bjmsoftware.com
> http://www.bjmsoftware.nl

Re:Stop user from entering table design mode


Quote
>I see what you mean, this behaviour should be sufficient. How do I open the
>table programmatically (I only know how to do queries and commands)?

You can simply use a TADOQuery and do a select on the table you need
to keep open. I'd specify readonly access for that query to ensure the
least possible interference with other operations - and possibly make
sure I only selected a single record to keep resource use as low as
possible. Just remember to close all those queries when your app
finishes and remember that you won't be able to open any table
exlusively while you have it open like this.

Marjan
____________________________
Marjan Venema - BJM Software
http://www.bjmsoftware.com
http://www.bjmsoftware.nl

Re:Stop user from entering table design mode


I see. Thanks.

--
Chuck

Quote
"Marjan Venema" <i...@bjmsoftware.OhNoNotThis.com> wrote in message

news:kb8a9v0l6qrthuv8gldmlmc5n3t7i67pk4@4ax.com...
Quote
> >I see what you mean, this behaviour should be sufficient. How do I open
the
> >table programmatically (I only know how to do queries and commands)?

> You can simply use a TADOQuery and do a select on the table you need
> to keep open. I'd specify readonly access for that query to ensure the
> least possible interference with other operations - and possibly make
> sure I only selected a single record to keep resource use as low as
> possible. Just remember to close all those queries when your app
> finishes and remember that you won't be able to open any table
> exlusively while you have it open like this.

> Marjan
> ____________________________
> Marjan Venema - BJM Software
> http://www.bjmsoftware.com
> http://www.bjmsoftware.nl

Other Threads