PC Review


Reply
Thread Tools Rate Thread

Capturing Database Properties

 
 
ACG via AccessMonster.com
Guest
Posts: n/a
 
      2nd Jun 2005
My problem seems quite simple!!! I am using Access 97 and what I am trying
to do is determin if a database properties are set to ReadOnly. i.e. What I
want to do is a simple check when a datbase is opened and if the properties
are Read Only display a message and quit.

At the moment, to get round the problem ,I have set up a temp table and try
to write to to it and if this errors because it is read only display the
message etc - but I think there must be an easier way.

Thanks in advance and any assistance would be greatly received.

--
Message posted via http://www.accessmonster.com
 
Reply With Quote
 
 
 
 
TC
Guest
Posts: n/a
 
      3rd Jun 2005
Access already gives you a warning message when you open a read-only
mdb file.

Do you want to replace that message, or add your own one afterwards?

TC

 
Reply With Quote
 
Alan Green via AccessMonster.com
Guest
Posts: n/a
 
      3rd Jun 2005
Either really, but proberbly just add my own after the Access one. The
main thing is to give the user the warning and then quit the database.

--
Message posted via http://www.accessmonster.com
 
Reply With Quote
 
TC
Guest
Posts: n/a
 
      4th Jun 2005
I recommend that you review the message that Access already displays in
this case. It might or might not make sense to add your own message,
depending on the wording of the Access one. There's no way to suppress
the Access one, afaik.

Apart from the message, your next need is to quit the database (when it
is read-only). I /should/ know a simple, clean way of testing that, but
I can't think of it off the top of my head (and I don't have Access
here to check).

So, why not stick with your current method of trying to update a field
in a record? If you've already coded that, all you'd need is an On
Error statement to detect the right error, & quit the db.

Something like:

on error resume next
<try to update a field in a record>
select case err.number
case 0
' it worked.
case 9999
' oops, db is read only.
msgbox "no way jose!"
application.quit
case else
' some other, unexpected error.
msgbox "error " & err.number & _
": " & err.description
' quit, end, whatever ...
end select
on error 0

You'd need to replace '9999' with whatever error number you get in your
case.

HTH,
TC

 
Reply With Quote
 
ACG via AccessMonster.com
Guest
Posts: n/a
 
      4th Jun 2005
Thanks for the help, and I like your code - it's certainly neater than mine.

--
Message posted via http://www.accessmonster.com
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Manage Database Properties/Database Documenter LisaH Microsoft Access 2 27th Sep 2008 01:04 AM
Capturing Word Doc properties SBD Microsoft Access 2 14th Apr 2004 10:37 AM
Capturing Word Doc properties SBD Microsoft Word Document Management 1 10th Apr 2004 09:31 AM
Capturing e-mail messages from Novell Groupwise in Access database Molly J. Fagan Microsoft Access External Data 1 4th Feb 2004 11:15 PM
Capturing Network User IDs in a Table/Database Traci Microsoft Access VBA Modules 1 11th Aug 2003 10:44 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:06 PM.