Solved

Simple one - ODBC connection file - Database security.

Posted on 2004-04-14
4
836 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
  • 2
4 Comments
 
LVL 12

Assisted Solution

by:dfiala13
dfiala13 earned 200 total points
Comment Utility
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
Comment Utility
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 300 total points
Comment Utility
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
Comment Utility
@ 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now