Link to home
Start Free TrialLog in
Avatar of sciber_dude
sciber_dudeFlag for United States of America

asked on

Simple one - ODBC connection file - Database security.

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?
SOLUTION
Avatar of dfiala13
dfiala13

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sciber_dude

ASKER

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
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
@ 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