Solved

Connection String to remote Server not working

Posted on 2016-10-09
3
101 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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Suggested Solutions

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

734 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