Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Raj Raj is offline
external usenet poster
 
Posts: 130
Default Data from Programmatically created Excel into SQL Server

Problem: Error when trying to query the excel file
"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."

We are developing a .NET component which automates the Excel to generate
some data and exports that data into SQL Server. Here are the steps for the
process:
1. Opens the pre formatted Excel file with required formulas in it.
2. Inserts the data into that spreadsheet.
3. Add/Remove some formulas depending on the conditions.
4. Save the file with different name and close the file.
5. Query the saved file to insert the data in to SQL using OleDb.

This process generates at least 12 files in a minute.

The problem is when we try to query the file. During this process we are
getting the below error:
"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."

I guess this problem may be occurring because the method that it created
this file is still holding this file. I tried to cleanup several ways by
using ReleaseComObject and GC etc. But it works well for first 3 or 4 files
again starts throwing the same error.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
SQL Server -- Bulk Insert from Excel to SQL Server Madhan Excel Discussion (Misc queries) 0 December 12th 06 03:08 PM
Excel 2003 Error Cannot Locate the Internet Server or Proxy Server Seabee Excel Discussion (Misc queries) 0 November 20th 05 12:03 AM
From Excel 97 Programmatically create access 97 or 2000 database and export data to. [email protected] Excel Programming 0 December 23rd 04 10:44 PM
Getting data from SQL Server into Excel Sophea Excel Programming 4 February 24th 04 10:30 AM
Help with data importing from txt file to excel programmatically SUDHENDRA Excel Programming 2 December 7th 03 02:14 PM


All times are GMT +1. The time now is 08:33 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"