Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

MS Access 2010 connection string problem

Posted on 2010-08-28
7
Medium Priority
?
4,891 Views
Last Modified: 2013-11-28
Hi
I am trying to connect to a secured access 2010 database from C++ code using ADODB
Windows 7, C++ compiled using VS2010

Using the following connection string:
"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Data\Dev\Candy\data\Candy.mdb;Persist Security Info=True;Jet OLEDB:System database=C:\Data\Dev\Candy\Data\Security.mdw;"

C++ code:
hr = conn->Open( connection_string, L"Terry", L"pwd", -1);

It fails returning
hr = 0x800A0C94
The error message  I get is:
Connection string = Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Data\Dev\Candy\data\Candy.mdb;Persist Security Info=True;Jet OLEDB:System database=C:\Data\Dev\Candy\Data\Security.mdw;
Details: Error: Unknown error 0x800A0C94
Description: Supplied provider is different from the one already in use.

Which is strange since this is the first connection the code does...
I could connect previous to making the database secured using the mdw file.
the following short cut to launch the secured database works: shortcut :
C:\Data\Dev\Candy\Data\candy.mdb /WRKGRP "C:\Data\Dev\Candy\Data\Security.mdw"


Help!
0
Comment
Question by:10Pints
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 38

Accepted Solution

by:
puppydogbuddy earned 2000 total points
ID: 33549060
Try the connection string syntax provided at this link:
         http://www.connectionstrings.com/access-2007

For one thing, note that security is not persisted in the example syntax.
0
 

Author Comment

by:10Pints
ID: 33549247
Thanks! Got it working now: I had looked at this and a load of others. Something was wrong when I changed the connection string code (adding a separate db password string)
Tried accessing a data base password protected DB got  the error
Tried setting an mdw file and doing the full DB protection thing ... Same error
Tried backing out all changes back to an unsecured DB ... still got the error ... oops!
Went back to old code and did a diff using Beyond compare could see no real difference maybe a lowercase p on the "Provider=" clause

Then suddenly it worked - not really sure what was wrong now as the new code did  a lot of extra things and time I had butchered it to try get to at least connect in the simplest fashion got confused... lost all will to live really...

Might leave the connection to a fully secured database - so long as I have a password protected DB that is good

Thanks for help - is there any real gain in using an MDW secured database against using just a password protected DB?
0
 
LVL 38

Assisted Solution

by:puppydogbuddy
puppydogbuddy earned 2000 total points
ID: 33549405
a secured mdw is application( Access) level password security, which is an additional layer of security below a windows authentication.  Windows authentication would be sufficient if all of your users are allowed access to the application (MS Acess). If you have several applications and need to restrict which users have access to each application, than you need mdw security.    
0
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 

Author Comment

by:10Pints
ID: 33550714
Hi and thanks for comment. No it is more what to do with user names and passwords really - we have an access control model: a user has a set of roles. Each role has a set of actions. So only rolled user can perform certain actions - presumably after the requisite authorisation and training. So there currently is a visible  table of  users and their passwords. The gui restricts access to this, but anyone gaining access to the mdb file will be able to see them. a bit primitive really so now wew nearing the end of development I was looking at the ways Access support security. I guess the database password is enough? the MDW approach with its 'hidden' useres and passwords might be better?
0
 
LVL 38

Assisted Solution

by:puppydogbuddy
puppydogbuddy earned 2000 total points
ID: 33563598
The mdw approach is a key component of user level security for ms access, and is certainly more secure than a single DB password in a multi-user environment. See the link for an excellent overview of user level security for ms access.

     http://www.databasedev.co.uk/security_overview.html
0
 

Author Comment

by:10Pints
ID: 33567271
Thanks I will peruse that now I have the DB password connection working: I reckon its what we should have probably - many thanks for your valued help pls accept the points
0
 

Author Closing Comment

by:10Pints
ID: 33567289
Sorted!
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question