Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access 2000 error -2147467259

Status
Not open for further replies.

reidfl

Programmer
Sep 17, 2001
54
US
I'm writing code to populate a drop down box using Access 2000. When I open the form I get the following error message (error occurs with cnn.open) " -2147467259 The database has been placed in a state by user 'Admin' on machine 'XYZ' that prevents if from being opened or locked"

Has anyone experienced the problem? If so, what is the fix to resolve the issue?

Default open mode=Shared
Default record locking=Edited Record
Open databases using record-level locking is checked


Code snippet:
Private Sub Form_Load()
On Error GoTo ErrHandler

Dim rs As New ADODB.Recordset
Dim cnn As New ADODB.Connection
Dim sSql As String

If IsNull(Me.Model_No) = False Then

Me.Bike_Size.RowSource = ""
sSql = "SELECT Size_ID FROM Model_Size WHERE Model_ID Like" & Me.Model_No

With cnn
.Provider = "Microsoft.Jet.OLEDB.4.0"
.ConnectionString = "Data Source=F:\cellibini.mdb"
.Open
End With

rs.Open sSql, cnn, adOpenStatic, adLockReadOnly
If rs.RecordCount > 0 Then

Me.Bike_Size.RowSource = rs.Fields(0)
End If


End If

Done:
Exit Sub

ErrHandler:
If Err.Number <> 0 Then
MsgBox Err.Number & vbCrLf & Err.Description
Err.Clear
Resume Done
End If

End Sub
&quot;Keep Your Code Tight&quot;
 
I solve the issue. I just split the database to a front end and back end. Problem solved. &quot;Keep Your Code Tight&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top