ADO access to Excel: Exclusive vs Shared Access 
Author Message
 ADO access to Excel: Exclusive vs Shared Access

I am using ADO to connect to an Excel worksheet as my Data
Source using the Jet 4.0 OLE DB driver.  I want to be able
to connect to this worksheet from multiple processes at
the same time.  I have no need to update, insert or delete
the data, I simply want to perform select statements
against the worksheet.  When I try to connect from the
second process, it tells me another process has exclusive
access.  Is there any way in the connection string to open
access with read-only intent so it can be used by multiple
processes.  The connection string I am using is below:

With cn
  .Provider = "Microsoft.Jet.OLEDB.4.0"
  .ConnectionString = "Data Source=d:\Tables\test.XLS;" & _
             "Extended Properties=""Excel 8.0; HDR=no;"""  
  .Open
End With

Thanks,
Tim



Sun, 05 Dec 2004 01:09:15 GMT  
 ADO access to Excel: Exclusive vs Shared Access
Hi,

Try to play with Mode property of connection. Try to set it to adModeRead
before opening. I am not sure if it helps, but could be

--
Val Mazur
Microsoft MVP


Quote:
> I am using ADO to connect to an Excel worksheet as my Data
> Source using the Jet 4.0 OLE DB driver.  I want to be able
> to connect to this worksheet from multiple processes at
> the same time.  I have no need to update, insert or delete
> the data, I simply want to perform select statements
> against the worksheet.  When I try to connect from the
> second process, it tells me another process has exclusive
> access.  Is there any way in the connection string to open
> access with read-only intent so it can be used by multiple
> processes.  The connection string I am using is below:

> With cn
>   .Provider = "Microsoft.Jet.OLEDB.4.0"
>   .ConnectionString = "Data Source=d:\Tables\test.XLS;" & _
>              "Extended Properties=""Excel 8.0; HDR=no;"""
>   .Open
> End With

> Thanks,
> Tim



Sun, 05 Dec 2004 02:22:10 GMT  
 ADO access to Excel: Exclusive vs Shared Access
That worked.  Thanks Val.  I had tried the Mode setting
before with adShareDenyWrite, which didn't work, don't
know why I didn't just try adRead.  Thanks for your help.

Tim  

Quote:
>-----Original Message-----
>Hi,

>Try to play with Mode property of connection. Try to set
it to adModeRead
>before opening. I am not sure if it helps, but could be

>--
>Val Mazur
>Microsoft MVP



>> I am using ADO to connect to an Excel worksheet as my
Data
>> Source using the Jet 4.0 OLE DB driver.  I want to be
able
>> to connect to this worksheet from multiple processes at
>> the same time.  I have no need to update, insert or
delete
>> the data, I simply want to perform select statements
>> against the worksheet.  When I try to connect from the
>> second process, it tells me another process has
exclusive
>> access.  Is there any way in the connection string to
open
>> access with read-only intent so it can be used by
multiple
>> processes.  The connection string I am using is below:

>> With cn
>>   .Provider = "Microsoft.Jet.OLEDB.4.0"
>>   .ConnectionString = "Data Source=d:\Tables\test.XLS;"
& _
>>              "Extended Properties=""Excel 8.0;
HDR=no;"""
>>   .Open
>> End With

>> Thanks,
>> Tim

>.



Sun, 05 Dec 2004 02:37:49 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Exclusive or shared access to Access

2. ADO Exclusive access

3. ADO vs DAO when accessing data stored in MS Access

4. VB6 vs Excel vs Access...

5. VB6 vs Excel vs Access...

6. problem with exclusive access to an Access database.

7. Exclusive access to an Access Table

8. Exclusive Access, Access 2.0 NT 4.0 SP2 VB5

9. Linked Excel Shared Access

10. Running excel add-in (added into excel - not access) in Access VBA

11. read excel file in access 2000 lire fichier excel dans access 2000

12. OLE Access Excel (Datenimport von Excel in Access - muss nicht OLE sein)

 

 
Powered by phpBB® Forum Software