Database & SQL

Moderators: None (Apply to moderate this forum)
Number of threads: 1194
Number of posts: 2247

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Cannot open Excel File from VB2005 using SQL Server Stored Procedure Posted by GiovanniGH on 7 Feb 2012 at 5:27 PM
Hi, I need help!!!

I developed a program in VB 2005 which opens an Excel file using Interop, and I call it from an SQL Stored Procedure using xp_cmdshell. Everything works fine when I am working under Windows 2003 Server. The problem is when I try to call my program the same way, but under Windows 2008 Server. It throws an exception at the moment my programs tries to open the Excel file. I assumed it was an authentication issue, so I changed the login for the SQL Server Service to an administrator account, and I granted Full Control to Everybody over the folder where the Excel file resides, but the problem persists.

The error message says that the Excel file cannot be accessed because either the file is in use by another program (which it isn't) or the user doesn't have enough privileges.

Same problem happens under Windows 7.

I am using "Microsoft Excel 12.0 Object Library" in my Project.

By the way, I tried to run my program with a double click in windows explorer and it opened the Excel file with no problem. The problem is when I call my program from an SQL Server Stored Procedure using xp_cmdshell.

Any ideas?

Thanks in any advance for your help.

Giovanni @ Guatemala.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.