Access Object and Data Access Page

  • Thread starter Thread starter Neil G
  • Start date Start date
N

Neil G

I am trying to display serveral queries in a Data Access
Page with the Excel object. When the page is opened from a
web browser, the database gets locked (an LDB file opens).

How do I keep the Data Access Page from locking up the
Access database?
Can I add code to release the database at the end of the
Data Access Page? or is there code that I can modify
within the page to accomplish this?
 
Neil:

Any connection to an Access db will always create a lock file (an ldb) but
that does not necessarily mean that any records are locked. The LDB file
simply indicates a connection.

Examine the DAP code and look at the recordsets that are opened to display
data. Your dap has an ADO connection to the database. Set the code to open
the recordsets in read only fashion to eliminate locking. You can open a
keyset cursor with adLockReadOnly specified on the recordset as in:

myrs.Open SQLorQuery, adOpenKeySet, adLockReadOnly

Also make sure, where reasonably practical to use fields that are indexed
for your Where clauses to eliminate table scans by the Jet engine.

HTH
 
Back
Top