Learn Microsoft Access Advanced Programming Techniques, Tips and Tricks.

Change Secure DB to Unsecured

Introduction

It is very unlikely that you want to change the status of a Secured Database (implemented with Microsoft Access Security) to an unsecured one. This exercise become necessary when you want to install/share a Database in an unsecured environment.

Before we embark on this simple exercise to remove the security settings of a database, the first thing to do is to change the Ownership of the Database.  The Owner (the User who created the Database is the Owner) of the Database Object have full access rights to all objects within the database and can assign permissions to other Users or User-Groups as well.  Members of the Admins Group also have this privileges.



Points to remember:

  1. The User who attempts to convert the Database must have at least Read Permission to all Objects of the Database.
  2. The Hidden Objects, if any, cannot be transferred into the target Database.


The Conversion Process

The conversion process is very simple and it needs only few steps.

  1. Create a new Database.
  2. Select File - ->Get External Data - ->Import.
  3. Browse to the location of the Database, you are trying to convert, and open it.
  4. Select the Tables Tab and click on the Select All Command Button to select all the Tables to import.
  5. Repeat this method for all Queries, Forms, Reports, Macros and Modules.
  6. If your Database have Custom Menus and Toolbars then click on Options.
  7. Put a check-mark in the Menus and Toolbars option.
  8. Click OK to Import all Objects (other than hidden objects) into the new Database.

Access privileges of all objects of the new database have now set to default.  By default, all Users of the new Database are the members of the Users Group and they all have Full Access Rights (to Open/Run, Read Design, Modify Design, Administer permissions) to all Objects.

But, if you plan to share this unsecured database on a Network you should do few changes to make it available for concurrent use.  Otherwise the database cannot be used by more than one user at the same time.



Changes for Multi-User Environment.

  1. Select Tools - ->Options - ->Advanced.
  2. Select Shared under the Default Open Mode Options Group.
  3. Select Edited Record under the Default Record Locking Options GroupOpen Database using Record Level Locking Option is already in selected state also.
  4. Click OK to Close the Dialog Box.
  5. Select Tools - -> Security - -> User and Group Permissions.
  6. Select Admin User Name under the User/Group Name List. 

    Why selected Admin User Account? Because in an unsecured environment all Users are silently logged in as  Admin User.  MS-Access will not prompt for UserId and Password.

  7. Select the Database Object in the Object Type Control.
  8. Remove the check-mark from the Open Exclusive Option.
  9. Click OK to close the Dialog Box.

Now, you have a brand new Database with no Security settings.  The old database will remain without change.

Technorati Tags:

  1. Microsoft Access Security
  2. Convert Ms-Access Old Versions
  3. Convert Old Version Workgroup File
  4. Share Previous Version Database

Share:

Date and Time Values

Introduction

MS-Access have Date/Time Data Field Type to store Date or Time or both Date and Time together.  When you enter a Date Value into the Field (such as 14/07/2010) the actual value stored in memory is a whole number 40373, the number of days from 30-12-1899.  Day 1 is 31-12-1899.

You can easily find this if you type ? format(1,"dd/mm/yyyy") in the Debug Window (Alt+F11 to display VBA Editing Window and Ctrl+G to show Debug Window) and pressing Enter Key to show the result value 31-12-1899.

Like Date; Time is internally stored as a Decimal Number. Time at midnight is 0.0 and 0.5 at 12 Noon. So the Date and Time Value combined on 14th July 2010 at 12 Noon is 40373.5.

To find the difference in time between Midnight and a time value before that, the midnight value will be taken as 24.00 for calculation purposes instead of 0.00.

Type ? format(40373.5,"dd/mm/yyyy hh:nn:ss") and press Enter Key.

Result:  14/07/2010 12:00:00

It is interesting to explore as how 0.5 becomes 12:00:00 noon or how the System maintains Date and Time internally?

We know we have 24 Hours in a Day or 24 x 60 = 1440 minutes in a Day or 24 x 60 x 60 = 86400 Seconds in a Day.


Time Calculations

That is 1 Second = 1 Day/86400 Seconds = 0.000011574074074074 Day (we can take it rounded as 0.0000115741).  The end value 074 is infinite.

From Midnight the Value 0.0000115741 (equal to one Second) is added to the Time of the Day Value at every one Second interval. One Second before midnight (23:59:59 Hrs.) the value is 0.9999906659 (86399 Seconds) and after one second; a Day is added to the Date Value.  So at Midnight of 14/07/2010 the Number of Days become 40374.

But, each Second is further divided into Milliseconds and this can be read with the  use of Timer Built-in Function.

For example type the following direct command in the Debug Window:

? Timer

You will get the output something like the example given below depending on the time you try out this.

Result in Seconds: 68473.81

The Value .81 part is the time in milliseconds and 68473 the number of seconds of the current time of the day.

If you want to see this value in Current Time of the Day format type the following expression in Debug Window and press Enter Key:

? format(68473.81/86400,"hh:nn:ss")

OR

? format(68473.81*0.0000115741,"hh:nn:ss")

The Value of 68473.81 Seconds are converted into its equal value in Days by multiplying it with 0.0000115741.

Result: 19:01:14


Using Timer Function.

You can use the Timer() Function to build a delay loop in Program, like the example given below, to slow down some action in Programs.

Public Function myFunction()
.
.
.
t = Timer
Do While Timer < t + 5 

  DoEvents

Loop
.
.
.
End Function

The sample program segment above slows down the action by 5 Seconds before executing the next statement after the Loop statement.

We can get the current Date and Time Value from the System with the use of Now() Built-in Function.  The Date() Function returns the Current System Date. 

While designing a Table you can set the Default Value Property of the Date/Time Field to Date() Function or Now() Function to insert Current System Date or Current Date and Time Stamp respectively, when a new record is added to the Table.

Share:

MS-Access Tips on your Finger-Tip

  • Download Android App 'MSA Guru' Version of LEARN MS-ACCESS TIPS AND TRICKS from Google Play Store.

Want to Post Free Ads on the Web


Translate



PageRank
Subscribe in a reader
Your email address:

Delivered by FeedBurner

Search

Popular Posts

Blog Archive

Powered by Blogger.

Follow by Email

Labels

Forms Functions How Tos MS-Access Security Reports msaccess forms Animations msaccess animation Utilities msaccess controls Access and Internet MS-Access Scurity MS-Access and Internet Class Module External Links Queries Array msaccess reports Accesstips WithEvents msaccess tips Downloads Menus and Toolbars Objects Collection Object MsaccessLinks Process Controls Art Work Property msaccess How Tos Dictionary Object Graph Charts Query VBA msaccessQuery Calculation Combo Boxes Event List Boxes Command Buttons Controls Data Emails and Alerts Form Custom Functions Custom Wizards DOS Commands Data Type Object Reference ms-access functions msaccess functions msaccess graphs msaccess reporttricks Command Button Key Report msaccess menus msaccessprocess security advanced Access Security Add Auto-Number Field Type Form Instances Item Macros Menus RaiseEvent Recordset Top Values Variables Wrapper Classes msaccess email progressmeter Access2007 Copy Excel Export Expression Fields Join Methods Microsoft Numbering System Records Security Split SubForm Table Tables Time Difference TreeView Control Utility Workgroup database function msaccess wizards tutorial Access Emails and Alerts Access Fields Access How Tos Access Mail Merge Access2003 Accounting Year Action Animation Attachment Binary Numbers Bookmarks Budgeting ChDir Color Palette Common Controls Conditional Formatting Data Filtering Database Records Defining Pages Diagram Disk Dynamic Lookup Error Handler External Filter Formatting Groups Hexadecimal Numbers ImageList Control Import Labels List ListView Control Logo Macro Mail Merge Main Form Memo Monitoring Nodes Octal Numbers Operating System Paste Primary-Key Product Rank Reading Remove Rich Text Sequence SetFocus Summary Tab-Page Union Query User Users Water-Mark Word automatically commands hyperlinks iSeries Date iif ms-access msaccess msaccess alerts pdf files reference restore switch text toolbar updating upload vba code