Error on reading access table

Joined
Jul 18, 2005
Messages
1
Reaction score
0
Dear All

I have a 5 user vb.net app that is trying to display in a grid what it reads from an MS Access table. The access database lives on a win2003 network share. The grid is updated by a subroutine called by a timer, which was intended to fire every few seconds.

Now the app works fine on one computer - but when I run it on 5 computers at once, I will soon get an exception error on one saying "Cannot lock file". If I speed up the timer to fire several times a second, it will likely fail quickly if not immediately. Its not a permissions issue - since it will give the error from two instances of the app running on the same machine.

I've tried all different combinations of connection statement and come to the end of my ideas.

Does the .Fill method put an exclusive lock on the database - regardless of what you say in the connection string? And if another user uses the .fill method at the same time will they get an immediate exception? Is there any way round this?


many thanks
Phil



Me.OleDbConnection1.ConnectionString = "Jet OLEDB:Registry Path=;Mode=share deny none ;Jet OLEDB: Database Locking Mode=1;JetOLEDB: Database Password=; Data Source=""I:\testdb.mdb""" & _
";Password=;Jet OLEDB:Engine Type=5;Provider=""Microsoft.Jet.OLEDB.4.0"""
...
...
Me.OleDbSelectCommand1.CommandText = "SELECT A, B, C, D FROM datatable"
Me.GridControl1.DataSource = Me.DataSet11
Me.OleDbSelectCommand1.Connection = Me.OleDbConnection1
Me.OleDbDataAdapter3.SelectCommand = Me.OleDbSelectCommand1
...
...
Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Call reloadgrid(True)
End Sub
...
...
Private Sub reloadgrid
OleDbDataAdapter3.Fill(DataSet11)
end sub
 
Last edited:

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