Error with Excel Files
i have 20 to 30 excel files in a directory.
So i would have to use a foreach loop and loop thru the excel files and get the data from the excel file and dump the data into the sql server tables.
Now the thing here is something like this, if would have to skip the first 15 rows in the excel and i get the data from the 16th row and dump those values from the excel into sql server tables. This works perfectly fine when i do that for 1 excel file
For the Excel source, i use this property "OpenRowset" and i set it to Sheet1$B16:AR100
when i try to implement the foreach loop with variables, i bombs out on the first and it says
"[Excel Source [1]] Error: Opening a rowset for "Sheet1$B16:AR200" failed. Check that the object exists in the database. "
As i told you, that works perfectly fine if i am working on just one single excel sheet, but it fails when i try to use a foreach loop and try to work on multiple excel files
Going crazy from the past 1 day about his now
Eagerly waiting for your replies
thanks againThanks
May 17th, 2011 2:06pm
Hi hpjack433, would you disclose please
how you mapped the variables? I sense there is an issue with the Excel source conn string.
Arthur My Blog
Free Windows Admin Tool Kit Click here and download it now
May 17th, 2011 2:14pm
As ArthurZ said they might be a problem with connection string :
Check these:
http://www.sqlis.com/sqlis/post/Looping-over-files-with-the-Foreach-Loop.aspxlatha
May 17th, 2011 2:18pm
Sorry for the trouble
i was having some files in the folder and one excel was completely different one and it naturally fails
sorry and thanks a lotThanks
Free Windows Admin Tool Kit Click here and download it now
May 17th, 2011 2:38pm