Unable to open Excel file in read-only if file already open by another user
- From: "Rab" <saurabh.singhania@xxxxxxxxxxxxxxxxxxxx>
- Date: 11 Nov 2005 01:20:11 -0800
Hi
I need to process data from Excel files (into our SQL Server DB) using
SELECT query on a daily basis. The data in these Excel files are
entered by different user departments and they may have the file open
all day (in Exclusive mode).
The code I'm using now works fine as long as the Excel file is closed
(see code below):
Dim cnnXL as ADODB.Connection
Set cnnXL = New ADODB.Connection
cnnXL.Mode = adModeRead
cnnXL.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=X:\Path\Filename.xls;" & _
"Extended Properties=""Excel
8.0;HDR=Yes;IMEX=1"";"
.... [code to retrieve data into recordset, validate and write to SQL
server]
The code throws the following error "The Microsoft Jet Database engine
cannot open the file. It is alredy open by another user, or you need
permission to view its data" as soon as it executes the Open statement
on an already open file. We are using MDAC v2.8,
Any suggestions how to get around this problem?
TIA
Rab
.
- Follow-Ups:
- Prev by Date: Re: Microsoft Access and Transaction Isolation Level
- Next by Date: Re: Microsoft Access and Transaction Isolation Level
- Previous by thread: Bulk copy question
- Next by thread: Re: Unable to open Excel file in read-only if file already open by another user
- Index(es):
Relevant Pages
|
|