Database locked when go into form design view

E

ES

I had a discussion going on this yesterday but did not get it resolved. So I
set up a testing db with one form, one command button, and one module. Also
set the reference to Microsoft ActiveX Data Objects 2.7 Library. Can
someone try this and let me know why the db is locked when the form goes to
form view from design view.

If I open the form straight into form view, it runs fine BUT if I go into
design view I have to close the form then open in form view to get it to work
again.

Here is the Error:

“The database has been placed in a state by user ‘Admin’ on machine
‘1233455…†that prevents it from being opened or lockedâ€

Here is all the code in the test db.

Private Sub Command0_Click()
ADO_Test
End Sub

Public Sub ADO_Test()
Dim conn As ADODB.Connection
Dim strConn As String
Dim strSQL As String


On Error GoTo ERRORCATCH



'Create the ADO Connection object
Set conn = New ADODB.Connection

'Specify a valid connection string

strConn = "Data Provider=Microsoft.Jet.OLEDB.4.0;"
strConn = strConn & "Data Source = " & _
CurrentProject.Connection.ConnectionString
conn.ConnectionString = strConn


'Specify the Data Shaping provider
conn.Provider = "MSDataShape"

'Open the connection
conn.Open

MsgBox "connection open"

conn.Close
Set conn = Nothing
MsgBox "connection closed"

Exit Sub

ERRORCATCH:
If Err.Number = -2147217904 Then
MsgBox "File format not correct, please check file.", vbOKOnly
Err.Clear
Else
MsgBox "Unspecified data error. Please Check Database File for
correct table strucure.", vbOKOnly
Err.Clear

End If
End Sub
 
E

ES

forgot to add this info.

Other info:
Running Access 2003
No security set on the databae
Default open mode = shared
Default record locking = no locks
Database is on my machine and there are no other users
 
E

ES

OK, I checked the permissions. If I uncheck the Open Exclusive for admin and
users on the database object it will run coming out of design view. However,
it will not let me save changes. I know very little about security settings
in Access, can someone guide me on how it should be set so I can make design
changes and still have this code work when I move from design view to form
view? The security settings were set at the default Access settings as I had
not looked at the permissions.

THANKS!
 
E

ES

looks like it maybe a security setting so I reposted under the Access
Security Discussion

Thanks again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top