Thread: Access Database
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] troy@sigwing.net is offline
external usenet poster
 
Posts: 3
Default Access Database

So I can access the Access Database using the following:

Dim myDB As ADODB.Connection
Dim myRS As ADODB.Recordset
Set myDB = New ADODB.Connection
Set myRS = New ADODB.Recordset


myDB.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=M:\Work
Log\Work Log .mdb;USER ID=Facilities;Password=;"
myRS.Open "SELECT DISTINCT `Jamis #` FROM `Work Log` `Work Log` WHERE
status < 'Complete' or status < 'Canceled' or status < 'On Hold'",
myDB, adOpenDynamic, adLockReadOnly


and it works fine if nobody has the database open, however if someone
has the database open, I get an error. Anyway around this?