Advertisement

05.03.2008 at 05:01PM PDT, ID: 23374379 | Points: 500
[x]
Attachment Details
How do I read and write to a hidden MS Access database file using VB6?
Tags: Microsoft, Visual Basic 6, VB6, MS Access
I have a VB6 multiuser application that uses DAO to read from and write to a MS Access XP Database file on a central server. The Database File is password protected but there is nothing to stop 'General Users' using 'Explorer' or 'My Computer' to open the network directory with the Database File and copy, delete or try to open it etc!
How can the Network Permissions be set up so that 'Administrators' can login and Maintain the Database File but 'General Users' can not copy/delete/open the file? (I have tried to set the Directory Security Permissions to read only for 'Users' but this sometimes causes a 'Database Locked conflict' and the VB6 application shuts down. Also, the VB6 app won't work by simply setting  Hidden Attribute on the Database File to true!)
Start your free trial to view this solution
Question Stats
Zone: Microsoft
Question Asked By: maxstinky
Question Asked On: 05.03.2008
Participating Experts: 2
Points: 500
Views: 0
Translate:
Loading Advertisement...
05.03.2008 at 06:19PM PDT, ID: 21494261

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.03.2008 at 06:59PM PDT, ID: 21494348

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.03.2008 at 09:19PM PDT, ID: 21494557

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.03.2008 at 10:15PM PDT, ID: 21494622

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.04.2008 at 05:29AM PDT, ID: 21495511

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.04.2008 at 07:33AM PDT, ID: 21495754

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.04.2008 at 07:59AM PDT, ID: 21495843

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.04.2008 at 04:28PM PDT, ID: 21497369

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.04.2008 at 06:40PM PDT, ID: 21497689

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.04.2008 at 06:41PM PDT, ID: 21497690

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
Microsoft
  • Internet Protocols
  • Applications
  • Development
  • OS
  • Hardware
  • Windows Security
Apple
  • Operating Systems
  • Hardware
  • Programming
  • Networking
  • Software
Internet
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Spy / Ad Blockers
  • Web Browsers
  • New Net Users
  • Web Development
  • Chat / IM
  • Anti Spam
  • Web Servers
  • Anti-Virus
  • Email Clients
Gamers
  • Tips
  • Online / MMORPG
  • Puzzle
  • Emulators
  • Action / Adventure
  • Role Playing
  • Consoles
  • Game Programming
  • Strategy
  • Sports
  • Misc
  • Computer Games
Digital Living
  • Hardware
  • New Net Users
  • New Users
  • Software
  • Digital Music
  • Gaming World
  • Home Security
  • Apple
  • Networking Hardware
Virus & Spyware
  • Vulnerabilities
  • IDS
  • Encryption
  • Anti-Virus
  • Operating Systems Security
  • Software Firewalls
  • WebApplications
  • Cell Phones
  • Operating Systems
  • Internet
  • Hardware Firewalls
Hardware
  • Handhelds / PDAs
  • Displays / Monitors
  • Components
  • Networking Hardware
  • Peripherals
  • Laptops/Notebooks
  • Storage
  • Servers
  • Desktops
  • New Users
  • Misc
  • Apple
Software
  • System Utilities
  • Industry Specific
  • Network Management
  • Photos / Graphics
  • Page Layout
  • VMWare
  • Misc
  • Web Development
  • OS
  • CYGWIN
  • Voice Recognition
  • Message Queue
  • Quality Assurance
  • Security
  • Firewalls
  • MultiMedia Applications
  • Development
  • Database
  • Office / Productivity
  • Business Management
  • OS/2 Apps
  • Server Software
  • Internet / Email
ITPro
  • OS
  • Storage
  • Encryption
  • Operating Systems Security
  • Apple Hardware
  • Laptops & Notebooks
  • Servers
  • Networking Hardware
  • Peripherals
  • Devices
  • Displays / Monitors
  • WebTrends / Stats
  • Search Engines
  • Firewalls
  • WebApplications
  • IDS
  • Vulnerabilities
  • Email Clients
  • File Sharing
  • Spy / Ad Blockers
  • Web Browsers
  • Web Servers
  • Networking
  • Anti-Virus
  • Chat / IM
  • Anti Spam
Developer
  • Web Servers
  • Web Browsers
  • Game Programming
  • Dev Tools
  • Industry Specific
  • Office / Productivity
  • Database
  • CYGWIN
  • Web Development
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Programming
  • Content Management
  • Application Servers
  • Protocols
Storage
  • Removable Backup Media
  • Storage Technology
  • Servers
  • Grid
  • Remote Access
  • Backup / Restore
  • Misc
  • Hard Drives
OS
  • Miscellaneous
  • Security
  • Development
  • Linux
  • VMWare
  • MainFrame OS
  • Unix
  • Apple
  • OS / 2
  • AS / 400
  • BeOS
  • Microsoft
  • VMS / OpenVMS
Database
  • Oracle
  • Miscellaneous
  • MySQL
  • Software
  • Sybase
  • Contact Management
  • PostgreSQL
  • Data Manipulation
  • Clarion
  • InterSystems Cache
  • Siebel
  • MUMPS
  • OLAP
  • SQLBase
  • SAS
  • GIS & GPS
  • 4GL
  • Berkeley DB
  • DB2
  • Informix
  • Interbase / Firebird
  • FoxPro
  • Reporting
  • LDAP
  • Filemaker Pro
  • MS SQL Server
  • dBase
  • MS Access
Security
  • Misc
  • Web Browsers
  • Software Firewalls
  • Operating Systems Security
  • File Sharing
  • Spy / Ad Blockers
  • Vulnerabilities
  • WebApplications
  • IDS
  • Anti-Virus
  • Encryption
  • Anti Spam
  • Email Clients
  • VPN
  • Chat / IM
Programming
  • Editors IDEs
  • Installation
  • Handhelds / PDAs
  • Multimedia Programming
  • System / Kernel
  • Algorithms
  • Game
  • Signal Processing
  • Project Management
  • Open Source
  • Database
  • Misc
  • Languages
  • Processor Platforms
  • Theory
Web Development
  • Scripting
  • Blogs
  • Web Servers
  • Software
  • Search Engines
  • Web Graphics
  • Images
  • Internet Marketing
  • Images and Photos
  • Components
  • Document Imaging
  • Web Languages/Standards
  • Illustration
  • WebApplications
  • Fonts
  • WebTrends / Stats
  • Authoring
  • Digital Camera Software
  • Miscellaneous
Networking
  • Protocols
  • Apple Networking
  • Network Management
  • Message Queue
  • Application Servers
  • Content Management
  • File Servers
  • Email Servers
  • Misc
  • Java Editors & IDEs
  • Wireless
  • Networking Hardware
  • Backup / Restore
  • System Utilities
  • ISPs & Hosting
  • Web Servers
  • Storage Technology
  • Removable Backup Media
  • Servers
  • Broadband
  • Grid
  • OS / 2
  • Novell Netware
  • Unix Networking
  • Windows Networking
  • Security
  • Telecommunications
  • Operating Systems
  • Linux Networking
Other
  • Community Advisor
  • Lounge
  • Community Support
  • New Net Users
  • Philosophy / Religion
  • Math / Science
  • Miscellaneous
  • URLs
  • Expert Lounge
  • Politics
  • Puzzles / Riddles
Community Support
  • Suggestions
  • New to EE
  • New Topics
  • Community Advisor
  • CleanUp
  • Announcements
  • General
  • Feedback
  • Input
  • EE Bugs
 
05.03.2008 at 06:19PM PDT, ID: 21494261

Rank: Genius

In order to open/use the database file your users must have Modify permissions (which includes the permission to delete this file). Since Access/Jet is a file-based database, you cannot deny users the ability to delete while still allowing them full access (assuming you want them to read/write to the db, that is). Unfortunately, the answer is to move to a server-type database, which allows you much more latitude in this area.
 
05.03.2008 at 06:59PM PDT, ID: 21494348
Thanks for this response, and the future plan is to definitely move to a server-type database, however this is a big move and as such is not a short term solution.

Thus I was hoping there may be a way to 'hide' the Database File on the Network from the 'General User' but in effect always 'show' it to the VB6 app?

Also, I think my DAO connection string is very basic, ";PWD=" & dbPassword (see attached code), so is there a way to assign better permissions, and/or better database sharing rights, with the connection string?
1:
2:
3:
4:
5:
Dim WS as WorkSpace
Dim DB as Database
 
Set WS = CreateWorkspace("", "admin", "", dbUseJet)
Set DB = WS.OpenDatabase(dbName, False, False, ";PWD=" & dbPassword)
Open in New Window
 
05.03.2008 at 09:19PM PDT, ID: 21494557

Rank: Guru

Have you tried removing "List Folder Contents" from the user/group permissions?  Then you could rename the database into something that wasn't intuitive and redistribute the (updated) VB application.
 
05.03.2008 at 10:15PM PDT, ID: 21494622
Thanks for your response aikimark, I did try removing the 'List Folder Contents' permission but it acted similar to the 'Hidden' attribute where the VB app does not run because it is like it can not 'see' the file(s)

But what do you mean by "rename to something that wasn't intuitive", does this get around the 'hidden' issue?
 
05.04.2008 at 05:29AM PDT, ID: 21495511

Rank: Guru

You could name it anything like THX1138.DAT

If the users click on the file, it will not automatically open Access because the .DAT extension is not associated with the Access program.  That doesn't prevent a clever user from copying the file to their hard drive and renaming it with a .MDB extension.
 
05.04.2008 at 07:33AM PDT, ID: 21495754
Thanks aikimark, this definitely adds more security but it doesn't resolve the delete file issue which the 'clever user' will be able to do.
 
05.04.2008 at 07:59AM PDT, ID: 21495843

Rank: Guru

* set the priviledges to prevent deletion.
* keep backups
* have another program running on the server that keeps the database open during the day. (maintains an active connection)

===================
I guess this issue comes down to personnel and policies.  Release a statement that says that the users are no longer permitted to have a copy of the database on their PC, not allowed to open the database using any program other than the application, not allowed to perform any file activities on the folder's contents.  State that full auditing is enabled for the server and that all employees outside of the admin/support staff will only get one warning for violating these rules.  Second violation results in an immediate termination of employment.

All current and new employees need to sign an aknowledgement document of the rules and agree to abide by them.

Survey all users' hard drives, looking for a copy of the database.  Remove them and send notice that it has been removed in compliance with the rules.  Such first instance removals do not constitute a violation of the new rules.

If an employee refuses to sign the document, prevent them from gaining access to the network directory.
 
05.04.2008 at 04:28PM PDT, ID: 21497369
Thanks aikimark, your points 1 and 3 above look like they may resolve the deletion issue and I will invoke them and carry out some testing over the next few days. The Policies setup is a good idea and I'll look into this also.

One Question with point 1 though: Can the priveleges/permissions for a file or directory be specifically set to 'Prevent Deletion', and if so how, or are you simply talking about setting the priveleges to 'Read Only'?

Also, the Database File is protected and lives on the network and is backed up nightly. The chances of one of the employees trying to open it and having it on their PC is very remote, but still a possibility. The main worry is someone deleting the file or maybe hacking into the Network and Stealing the file.

Cheers and watch this space because you may get the points!!
 
05.04.2008 at 06:40PM PDT, ID: 21497689

Rank: Guru

file/folder privildeges include Delete.  If left unchecked, deletion is not allowed.

Note: It doesn't prevent someone from corrupting the file.

One thing you might want to do is to change from .MDB to .MDE.  You can automatically invoke some code when the database is opened within Access that will effectively close the database.  You can keep the original .MDB file safely under lock and key.
 
05.04.2008 at 06:41PM PDT, ID: 21497690

Rank: Guru

I think your intruder/hacker problem is probably worthy of a separate question.
 
 
20080236-EE-VQP-29 / EE_QW_2_20070628