Results 1 to 5 of 5

Thread: several instances of program need to use one data file

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2000
    Posts
    8
    I have a small executable which uses an excel file as a source for data. The program is such that several instances of it might need to be open at once. But when I open a second instance, I get:"the microsoft jet database engine cannot open ..the excel file..It is already open exclusively or you need permission."

    So can anyone tell me how to make the excel file readable by many instances at once?

    Thanks!

  2. #2
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844
    Maybe you can link your Excel sheet through MS Access, and have your clients access the MS Access database instead....?

  3. #3

    Thread Starter
    New Member
    Join Date
    May 2000
    Posts
    8
    Thanks, but the aim is to keep the overhead of new programs low - users won't have msaccess

  4. #4
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844
    If you need read/write permissions, it appears that you are S.O.L

    If you need read only access, you are OK

    This is ADO code
    Code:
        Dim cn As Connection
        Set cn = New Connection
        
        cn.Mode = adModeRead
        cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=sample.xls;Extended Properties=Excel 8.0"

  5. #5

    Thread Starter
    New Member
    Join Date
    May 2000
    Posts
    8
    Thanks Clunietp! I set the data1 object to read only and it works fine. Nice to have the code to do it as well

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width