JaedenRuiner
Well-known member
- Joined
- Aug 13, 2007
- Messages
- 340
- Programming Experience
- 10+
I've noticed this error several times, and I'm trying to find not only the reason for such a glitch, but also the solution for it as well.
When creating ad-hoc queries (using the OPENROWSET() function in the sql server T-SQL language) it happens without fail that even though I can load up an excel file without a problem, when my application is finished processing the first file, unless I close my application and restart it, if I try to load a second Excel file, I get this error:
My order of operation is quite simple really:
When I restart the process at stage 6, which basically is browsing for a new file and clicking a button on my form, I step through the process and it follows all the same patterns, clearing out the loaded dataset, closing the connection, creating a new connection, and it then attempts to load the Excel file but it doesn't load. I get the above error WITHOUT FAIL. Ideas? Suggestions? Please, I can deal for a moment with the necessity to shutdown and restart my app, but it should NOT have to do that just to create a stable connection to the database which allows ad-hoc processing.
Thanks
When creating ad-hoc queries (using the OPENROWSET() function in the sql server T-SQL language) it happens without fail that even though I can load up an excel file without a problem, when my application is finished processing the first file, unless I close my application and restart it, if I try to load a second Excel file, I get this error:
Now linked server(null) simply means that it isn't a "statically" linked, linked server, but an ad-hoc linked for on-the-fly access to the excel table. However, I am rather confused as to why it would work the first time i run my application, but when I go to process the next document (workbook) it fails.Cannot start a transaction for OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server (null)
My order of operation is quite simple really:
- Application Start
- Database Login
- Create Connection String with Login Parameters (User/Pass or Integrated Security)
- Create Connection to Database.
- Load Dataset for viewing.
- Select file for processing.
- Free Dataset, Close Connection.
- Create new Connection
- Process Ad-Hoc Query and rules upon the Imported Data.
- Close Connection
- Create New Connection
- Load Dataset for viewing.
When I restart the process at stage 6, which basically is browsing for a new file and clicking a button on my form, I step through the process and it follows all the same patterns, clearing out the loaded dataset, closing the connection, creating a new connection, and it then attempts to load the Excel file but it doesn't load. I get the above error WITHOUT FAIL. Ideas? Suggestions? Please, I can deal for a moment with the necessity to shutdown and restart my app, but it should NOT have to do that just to create a stable connection to the database which allows ad-hoc processing.
Thanks