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

x
?
Solved

Simple one - ODBC connection file - Database security.

Posted on 2004-04-14
4
Medium Priority
?
854 Views
Last Modified: 2012-08-13
This is a simple question and i feel pretty ridiculous to ask! But here it is anyway, coz i feel i have a mind block today.

* I have an Access Database
* I opened it exclusively
* Selected Tools >> Security >> Set database password
* Typed a new password "xyz" and retyped new password "xyz"

Then I edited my connection file to this

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
strDataPath = server.MapPath("database.mdb")

strConnectString = "Provider=Microsoft.Jet.OLEDB.4.0;"_
               & " Data Source= " & strDataPath & ";"_
               & " Mode=Share Deny None;User Id=admin;PASSWORD=xyz;"

if not IsObject("conn") then
     set conn=Server.CreateObject("ADODB.Connection")
     conn.ConnectionTimeout = 15
     conn.CommandTimeout =  10
     conn.Mode = 3 'adModeReadWrite
     if conn.state = 0 then
          conn.Open strConnectString
     end if
end if
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This is the error i got:-

Microsoft JET Database Engine (0x80040E4D)
Cannot start your application. The workgroup information file is missing or opened exclusively by another user.

Should i have created a workgroup? What am i missing?
0
Comment
Question by:sciber_dude
[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
  • 2
4 Comments
 
LVL 12

Assisted Solution

by:dfiala13
dfiala13 earned 800 total points
ID: 10828154
You set a database password, which is stored with the database, not the workgroup file.  The connection string User ID and password are validated via the workgroup file.  So the connection string is trying to pass the password and user ID to the default workgroup file, which has no knowledge of the user ID and password being sent to it.  It is still expecting User ID = "admin" and password = "".

Try this...
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
           "Data Source=c:\somepath\mydb.mdb;" & _
           "Jet OLEDB:Database Password=MyDbPassword", _
           "myUsername", "myPassword"
And check out

http://www.able-consulting.com/ADO_Conn.htm

for all kinds of connection strings


You're other option is to implement workgroup security.
0
 
LVL 11

Author Comment

by:sciber_dude
ID: 10828379
well.. let me rephrase my question.

I want my access database to be password protected.

What do i do and How do i change my code?

A step-by-step account is preferable coz i got a mind-block today. :(

SD
0
 
LVL 7

Accepted Solution

by:
brgivens earned 1200 total points
ID: 10828995
Dim conn

Set conn = Server.CreateObject("ADODB.Connection")
conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:Database Password=test"  <- password you created goes here
conn.Open Server.MapPath("test.mdb")
0
 
LVL 11

Author Comment

by:sciber_dude
ID: 11071461
@ brgivens -

Sorry for not responding to this question for so long. There were some issues here and I did not have access to these files (Murphy's Law). My permissions will be reinstated on Monday. Will check it and let you know.

:) SD
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

722 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