OleDB Connection string for reading an Excel file exclusively opened by other user

Can anyone tell me OleDB Connection string to be used for just reading an Excel file exclusively opened by other user?

I tried following connection string which did not work for me:-

"Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};Mode=Read;Extended Properties=\"Excel 8.0;HDR=YES;ReadOnly=true;\"";

This connection string throws following exception when is it opened by other user:-

The Microsoft Jet database engine cannot open the file ''. It is already opened exclusively by another user, or you need permission to view its data.

NOTEs:

  1. Excel file is kept on share so that multiple users can open it.
  2. Provider used:- Microsoft.Jet.OLEDB.4.0
  3. Excel file type:- MS Excel 97-2003 Worksheet
  4. Copying a file is NOT allowed

--------------Solutions-------------

I would suggest that you use a background thread to retry opening a connection on an interval for some time, and when you get a connection to the excel datasource, read all your data into memory and immediately close the connection, so that other processes can access the file.

Category:oledb Time:2011-05-02 Views:1

Related post

  • Using C# and ADO OLEDB connection string to create an excel file. How do i make the header row in excel bold? 2011-08-25

    I have set my connection string as follows:- "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + saveFilenameAndLocation + ";Extended Properties='Excel 12.0 xml; HDR=Yes' " I have specified that the first row is a header and my excel spreadsheet is cr

  • Oledb connection string for excel files 2011-04-28

    This is the oledb connection string I'm using while loading excel 2003 files. But I'm getting the error could not find installable ISAM`.' Please help me in this issue. What I'm doing wrong here. Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\FileUp

  • OleDb connection string for a local file 2012-02-24

    Using OleDb I am connecting to MS Access (v2003) database and my Project folder is MyHotApps and my OleDb Connection String is MyConString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source='C:\Users\Some User\Documents\Visual Studio 2010\WebSites\MyHo

  • Specification of Extended Properties in OleDb connection string? 2010-04-29

    At the moment I'm searching for properties for a connection string, which can be used to connect to an Excel file in readonly mode. Searching Google gets me a lot of examples of connection strings, but I can't seem to find a specification of all poss

  • how to write oledb connection string for oracle8i(in a remote machine) 2011-04-20

    How to write oledb connection string for oracle8i(in a remote machine)? I mean the iis is setup in my machine(the win7 system),but the oracle8i is installed in another win xp system,how to write the connection string? --------------Solutions---------

  • Connection String for a MS Access file? 2011-06-17

    I added a MS Access file into a project and VS created me a DataSet. I was very happy with that, but now I've a small problem: I want to have the connection string in the app.config file, to allow customer to edit it. I go to the app.config file and

  • SQL Server connection string in code vs config file in ASP.NET site 2011-11-18

    I already have a connection string in my config file <connectionStrings> <add name="ConnectionString" connectionString="Data Source=*;Initial Catalog=*;User ID=*;Password=*" providerName=".NET Framework Data Provider for SQL Server" /> Cu

  • LINQ - Connection String issue with the DBML file 2011-12-05

    I just changed the connection string parameter in APP.config file and the dbml file to point to the correct SQL server database. However, it is not working and I am debugging it. DirectCast(dbContext.Connection,System.Data.SqlClient.SqlConnection).Co

  • Help with a OleDB connection string for excel files 2010-12-29

    The problem i'm having is that the data adapter is looking at only the first row in each column to determine the data type. In my case the first column "SKU" is numbers for the first 500 rows then I happen to have SKU's which are mixed numbers and le

  • Extended Properties for for csv file OleDB connection string 2011-07-04

    a usual connection string would look like Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\file.csv;Extended Properties="text;HDR=Yes;FMT=Delimited"; but i need a way to specify further parameters like: ColNameHeader Format MaxScanRows CharacterSet Lo

  • connection string reading data from excel in asp.net 2010-05-18

    I am trying to read data from excel file in asp.net. I have added the connection string to webConfig file: <add name="xls" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=HPM_DB.xls;Extended Properties=Excel 8.0"/> But it shows m

  • c#, oledb connection string issue 2011-10-07

    I'm using .net4.0 and c# language. In my code i have a connection string oleConnection.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source = " + filepath + "; Extended Propertie s= \"Excel 12.0;HDR=yes\""; and it work well. But when i

  • How to specify metadata location in connection string when using an edmx file 2010-01-29

    I have a web project with a data model defined in an edmx file. The connection string starts like this: metadata=res://*/; This has worked fine for a while. But somebody else working on the project created a dll that also uses the entity framework an

  • How to validate the connection string comming from a text file 2010-10-30

    there is a way by which we parse any time input given by user... here i am taking the input of a connection string from a text file i am supposed to assume that the user who keeps this string in the text file can be trusted. but what if he makes a ty

  • Can OLEDB connection strings be configured to use Windows Authentication? 2011-03-02

    My knowledge on OLEDB is minimal at best. Is there a way to build a connection string to use a trusted Windows authentication rather than using User ID and Password? --------------Solutions------------- Yes. Here's an example for SQL Server 2008. Pro

  • i have a problem with adding a connection string into the web.config file 2011-05-25

    I want to add a connection string and give it name.. The connection string belongs to aspnetdb.mdf which was created when i added my CreateUserWizard. This is its connection string: Data Source=.\SQLEXPRESS;AttachDbFilename="D:\Documents and Settings

  • problem in extend string limit in generate excel file 2011-09-15

    I am using phpxls library for generating excel file. but it has a string limit of 255 characters in each cell and my string is greater then 255. How can i extend this string limit? I have tried to change in library for change the variable value. but

  • Linq-To-Entities connection strings for for multiple edmx files 2011-12-17

    I have a dot net 4.0 DAL library project that contains three edmx files. I chose to split my data model in three files because there are many tables in my db, and from what I've read here at Stackoverflow it seemed best practice to do so. But now I h

  • Plone: Passing connection string to zmysqlda from external file 2012-02-16

    I am connecting to database in Mysql from Plone(Zope) using ZMySQLDA connector in which it requires connection string in database username passwd format. But i need the connection string to be passed from external file so that i can change it from ex

Copyright (C) pcaskme.com, All Rights Reserved.

processed in 1.947 (s). 13 q(s)