Solved

Simple one - ODBC connection file - Database security.

Posted on 2004-04-14
4
844 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
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 300 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
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…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

830 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