Solved

Connection String to remote Server not working

Posted on 2016-10-09
3
118 Views
Last Modified: 2016-10-13
I have a c# application that needs to modify a value in a .CSV file.  Whilst developing the application I have used a local copy of the .CSV file and was able to read the contents of the .CSV file via the following connection string:

Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\MyLib; Extended Properties='text,HDR=yes;FMT=Delimited;ReadOnlt-false'

I now need to change this connection so that it reads the .csv file (of the same name)  from the remote server (Not a SQL server). I change the locally working connection string to:

Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\\remoteServerName\7.7\samples; Extended Properties='text, HDR=yes; FMT= Delimited;ReadOnly=false' ;User ID=MyUserId; Password=MyPassword;  

However I receive the following error message: "Cannot Start your application. The workgroup information file  is missing or opened exclusively by another user."


Using the supplied remote server name , user Id and password I can manually remote on to the server and edit the .csv document. So what is wrong with the connection string that I cannot connect via my application?

regards
Pat
0
Comment
Question by:pclarke7
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 33

Expert Comment

by:Big Monty
ID: 41836228
try the format found here by getting rid of the user ID property and changing the password parameter to "database password"

you may also want to try the JET provider, it works better with office apps

https://www.connectionstrings.com/excel/
0
 

Author Comment

by:pclarke7
ID: 41836806
Hi,
in the example given the password was on the excel spreadsheet. However in my situation the userid & password is of the server that the document is residing on. So they are too completely different situatons. The document That I am attempting to read is not password protected. However It does not exist locally. It resides on a file server.

regards
Pat
0
 
LVL 33

Accepted Solution

by:
Big Monty earned 500 total points
ID: 41836815
any userID and password you specify in the connection string are for the data source, not the server it resides on. Try it without specifying a userID or password. If that still doesn't work, then it's most likely a permissions error, meaning your account that's running your website (specified in IIS) does not have access to the location where the spreadsheet resides. you can verify this by copying the xls file to a location within your web site folder structure and see if you can connect.

you could also try creating a virtual directory that maps to your network location of the file: https://support.microsoft.com/en-us/kb/308150
0

Featured Post

Create CentOS 7 Newton Packstack Running Keystone

A bug was filed against RDO for the installation of Keystone v3. This guide is designed to walk you through the configuration for using Keystone v3 with Packstack. You will accomplish this using various repos and the Answers file.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question