Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear All,

I am developing such a database application which extract data from excel and save it to SQL Database.

My program is working fine at production server. But when it runs from client's PC it fails. Suppose I have a file "C:\test.xlsx". It works on Server but not working on client PC while same path/files exists.

I am using below queries: -

SQL
SELECT * FROM
OPENDATASOURCE('Microsoft.ACE.OLEDB.12.0','Data Source=C:\test.xlsx;Extended Properties=''Excel 12.0 XML;HDR=Yes;IMEX=1;''')...[Sheet1$]


Regards,

Anil Kumar
Posted
Comments
Michael_Davies 17-Nov-15 6:50am    
Fails in what way...What is the exact error message.

Do you have Microsoft.ACE.OLEDB.12.0 installed on the client?
[no name] 17-Nov-15 7:01am    
What error you are getting ?

1 solution

It's quite likely that it's a permissions problem: the root directory of most machines is protected these days, and read-write access to files in it defaults to forbidden - particularly when it's the root directory of the boot disk.

I'd strongly suggest that you store your DB in a more "user friendly" location: Where should I store my data?[^] should help.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900